aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-24 04:11:18 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-24 04:11:23 -0400
commit416dfdcdb894432547ead4fcb9fa6a36b396059e (patch)
tree8033fdda07397a59c5fa98c88927040906ce6c1a /sound
parent56449f437add737a1e5e1cb7e00f63ac8ead1938 (diff)
parent091069740304c979f957ceacec39c461d0192158 (diff)
Merge commit 'v2.6.30-rc3' into tracing/hw-branch-tracing
Conflicts: arch/x86/kernel/ptrace.c Merge reason: fix the conflict above, and also pick up the CONFIG_BROKEN dependency change from upstream so that we can remove it here. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/pxa2xx-ac97-lib.c15
-rw-r--r--sound/atmel/abdac.c4
-rw-r--r--sound/atmel/ac97c.c128
-rw-r--r--sound/atmel/ac97c.h14
-rw-r--r--sound/core/control.c35
-rw-r--r--sound/core/jack.c3
-rw-r--r--sound/core/oss/mixer_oss.c8
-rw-r--r--sound/core/pcm_compat.c11
-rw-r--r--sound/core/pcm_lib.c47
-rw-r--r--sound/core/pcm_native.c93
-rw-r--r--sound/core/seq/seq_compat.c9
-rw-r--r--sound/core/timer.c11
-rw-r--r--sound/isa/Kconfig10
-rw-r--r--sound/isa/opl3sa2.c1
-rw-r--r--sound/isa/sb/sb16_csp.c19
-rw-r--r--sound/isa/wavefront/wavefront_fx.c30
-rw-r--r--sound/isa/wavefront/wavefront_synth.c11
-rw-r--r--sound/isa/wavefront/yss225.c2739
-rw-r--r--sound/pci/ad1889.c4
-rw-r--r--sound/pci/ali5451/ali5451.c4
-rw-r--r--sound/pci/als300.c4
-rw-r--r--sound/pci/als4000.c4
-rw-r--r--sound/pci/au88x0/au88x0.c4
-rw-r--r--sound/pci/aw2/aw2-alsa.c4
-rw-r--r--sound/pci/azt3328.c4
-rw-r--r--sound/pci/ca0106/ca0106_main.c4
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c4
-rw-r--r--sound/pci/emu10k1/emu10k1x.c4
-rw-r--r--sound/pci/emu10k1/emufx.c41
-rw-r--r--sound/pci/emu10k1/io.c2
-rw-r--r--sound/pci/es1938.c4
-rw-r--r--sound/pci/es1968.c4
-rw-r--r--sound/pci/hda/hda_codec.c14
-rw-r--r--sound/pci/hda/hda_intel.c47
-rw-r--r--sound/pci/hda/patch_analog.c10
-rw-r--r--sound/pci/hda/patch_conexant.c21
-rw-r--r--sound/pci/hda/patch_realtek.c10
-rw-r--r--sound/pci/hda/patch_sigmatel.c57
-rw-r--r--sound/pci/ice1712/ice1712.c4
-rw-r--r--sound/pci/intel8x0.c103
-rw-r--r--sound/pci/maestro3.c4
-rw-r--r--sound/pci/mixart/mixart.c2
-rw-r--r--sound/pci/pcxhr/pcxhr.c2
-rw-r--r--sound/pci/sis7019.c2
-rw-r--r--sound/pci/sonicvibes.c4
-rw-r--r--sound/pci/trident/trident_main.c4
-rw-r--r--sound/ppc/powermac.c2
-rw-r--r--sound/soc/blackfin/bf5xx-ac97-pcm.c4
-rw-r--r--sound/soc/blackfin/bf5xx-i2s-pcm.c4
-rw-r--r--sound/soc/codecs/ak4535.c3
-rw-r--r--sound/soc/codecs/twl4030.c61
-rw-r--r--sound/soc/codecs/twl4030.h1
-rw-r--r--sound/soc/codecs/wm9705.c37
-rw-r--r--sound/soc/fsl/fsl_dma.c29
-rw-r--r--sound/soc/fsl/fsl_ssi.c99
-rw-r--r--sound/soc/omap/omap-mcbsp.c18
-rw-r--r--sound/soc/omap/omap-pcm.c2
-rw-r--r--sound/soc/omap/osk5912.c4
-rw-r--r--sound/soc/pxa/Kconfig10
-rw-r--r--sound/soc/pxa/Makefile2
-rw-r--r--sound/soc/pxa/magician.c558
-rw-r--r--sound/soc/pxa/pxa-ssp.c13
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c4
-rw-r--r--sound/soc/s3c24xx/Kconfig6
-rw-r--r--sound/soc/s3c24xx/jive_wm8750.c12
-rw-r--r--sound/soc/s3c24xx/s3c-i2s-v2.c18
-rw-r--r--sound/soc/s3c24xx/s3c2412-i2s.c2
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c2
-rw-r--r--sound/soc/soc-core.c20
-rw-r--r--sound/sparc/cs4231.c28
-rw-r--r--sound/usb/caiaq/Makefile4
-rw-r--r--sound/usb/caiaq/audio.c (renamed from sound/usb/caiaq/caiaq-audio.c)12
-rw-r--r--sound/usb/caiaq/audio.h (renamed from sound/usb/caiaq/caiaq-audio.h)0
-rw-r--r--sound/usb/caiaq/control.c (renamed from sound/usb/caiaq/caiaq-control.c)10
-rw-r--r--sound/usb/caiaq/control.h (renamed from sound/usb/caiaq/caiaq-control.h)0
-rw-r--r--sound/usb/caiaq/device.c (renamed from sound/usb/caiaq/caiaq-device.c)23
-rw-r--r--sound/usb/caiaq/device.h (renamed from sound/usb/caiaq/caiaq-device.h)0
-rw-r--r--sound/usb/caiaq/input.c (renamed from sound/usb/caiaq/caiaq-input.c)11
-rw-r--r--sound/usb/caiaq/input.h (renamed from sound/usb/caiaq/caiaq-input.h)0
-rw-r--r--sound/usb/caiaq/midi.c (renamed from sound/usb/caiaq/caiaq-midi.c)13
-rw-r--r--sound/usb/caiaq/midi.h (renamed from sound/usb/caiaq/caiaq-midi.h)0
-rw-r--r--sound/usb/usbaudio.c255
-rw-r--r--sound/usb/usx2y/us122l.c10
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c13
84 files changed, 1484 insertions, 3369 deletions
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index 7793d2a511ce..0afd1a8226fb 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -238,6 +238,8 @@ static inline void pxa_ac97_cold_pxa3xx(void)
238 238
239bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97) 239bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97)
240{ 240{
241 unsigned long gsr;
242
241#ifdef CONFIG_PXA25x 243#ifdef CONFIG_PXA25x
242 if (cpu_is_pxa25x()) 244 if (cpu_is_pxa25x())
243 pxa_ac97_warm_pxa25x(); 245 pxa_ac97_warm_pxa25x();
@@ -254,10 +256,10 @@ bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97)
254 else 256 else
255#endif 257#endif
256 BUG(); 258 BUG();
257 259 gsr = GSR | gsr_bits;
258 if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR))) { 260 if (!(gsr & (GSR_PCR | GSR_SCR))) {
259 printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n", 261 printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n",
260 __func__, gsr_bits); 262 __func__, gsr);
261 263
262 return false; 264 return false;
263 } 265 }
@@ -268,6 +270,8 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_warm_reset);
268 270
269bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97) 271bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97)
270{ 272{
273 unsigned long gsr;
274
271#ifdef CONFIG_PXA25x 275#ifdef CONFIG_PXA25x
272 if (cpu_is_pxa25x()) 276 if (cpu_is_pxa25x())
273 pxa_ac97_cold_pxa25x(); 277 pxa_ac97_cold_pxa25x();
@@ -285,9 +289,10 @@ bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97)
285#endif 289#endif
286 BUG(); 290 BUG();
287 291
288 if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR))) { 292 gsr = GSR | gsr_bits;
293 if (!(gsr & (GSR_PCR | GSR_SCR))) {
289 printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n", 294 printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n",
290 __func__, gsr_bits); 295 __func__, gsr);
291 296
292 return false; 297 return false;
293 } 298 }
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c
index 28b3c7f7cfe6..f2f41c854221 100644
--- a/sound/atmel/abdac.c
+++ b/sound/atmel/abdac.c
@@ -165,7 +165,7 @@ static struct snd_pcm_hardware atmel_abdac_hw = {
165 .buffer_bytes_max = 64 * 4096, 165 .buffer_bytes_max = 64 * 4096,
166 .period_bytes_min = 4096, 166 .period_bytes_min = 4096,
167 .period_bytes_max = 4096, 167 .period_bytes_max = 4096,
168 .periods_min = 4, 168 .periods_min = 6,
169 .periods_max = 64, 169 .periods_max = 64,
170}; 170};
171 171
@@ -502,7 +502,7 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev)
502 platform_set_drvdata(pdev, card); 502 platform_set_drvdata(pdev, card);
503 503
504 dev_info(&pdev->dev, "Atmel ABDAC at 0x%p using %s\n", 504 dev_info(&pdev->dev, "Atmel ABDAC at 0x%p using %s\n",
505 dac->regs, dac->dma.chan->dev->device.bus_id); 505 dac->regs, dev_name(&dac->dma.chan->dev->device));
506 506
507 return retval; 507 return retval;
508 508
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index dd72e00e5ae1..0c0f8771656a 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Driver for the Atmel AC97C controller 2 * Driver for Atmel AC97C
3 * 3 *
4 * Copyright (C) 2005-2009 Atmel Corporation 4 * Copyright (C) 2005-2009 Atmel Corporation
5 * 5 *
@@ -10,6 +10,7 @@
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/delay.h> 11#include <linux/delay.h>
12#include <linux/bitmap.h> 12#include <linux/bitmap.h>
13#include <linux/device.h>
13#include <linux/dmaengine.h> 14#include <linux/dmaengine.h>
14#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
15#include <linux/init.h> 16#include <linux/init.h>
@@ -65,6 +66,7 @@ struct atmel_ac97c {
65 /* Serialize access to opened variable */ 66 /* Serialize access to opened variable */
66 spinlock_t lock; 67 spinlock_t lock;
67 void __iomem *regs; 68 void __iomem *regs;
69 int irq;
68 int opened; 70 int opened;
69 int reset_pin; 71 int reset_pin;
70}; 72};
@@ -150,10 +152,10 @@ static struct snd_pcm_hardware atmel_ac97c_hw = {
150 .rate_max = 48000, 152 .rate_max = 48000,
151 .channels_min = 1, 153 .channels_min = 1,
152 .channels_max = 2, 154 .channels_max = 2,
153 .buffer_bytes_max = 64 * 4096, 155 .buffer_bytes_max = 2 * 2 * 64 * 2048,
154 .period_bytes_min = 4096, 156 .period_bytes_min = 4096,
155 .period_bytes_max = 4096, 157 .period_bytes_max = 4096,
156 .periods_min = 4, 158 .periods_min = 6,
157 .periods_max = 64, 159 .periods_max = 64,
158}; 160};
159 161
@@ -297,9 +299,11 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream)
297{ 299{
298 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); 300 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream);
299 struct snd_pcm_runtime *runtime = substream->runtime; 301 struct snd_pcm_runtime *runtime = substream->runtime;
300 unsigned long word = 0; 302 unsigned long word = ac97c_readl(chip, OCA);
301 int retval; 303 int retval;
302 304
305 word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));
306
303 /* assign channels to AC97C channel A */ 307 /* assign channels to AC97C channel A */
304 switch (runtime->channels) { 308 switch (runtime->channels) {
305 case 1: 309 case 1:
@@ -312,7 +316,6 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream)
312 default: 316 default:
313 /* TODO: support more than two channels */ 317 /* TODO: support more than two channels */
314 return -EINVAL; 318 return -EINVAL;
315 break;
316 } 319 }
317 ac97c_writel(chip, OCA, word); 320 ac97c_writel(chip, OCA, word);
318 321
@@ -324,13 +327,25 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream)
324 word |= AC97C_CMR_CEM_LITTLE; 327 word |= AC97C_CMR_CEM_LITTLE;
325 break; 328 break;
326 case SNDRV_PCM_FORMAT_S16_BE: /* fall through */ 329 case SNDRV_PCM_FORMAT_S16_BE: /* fall through */
327 default:
328 word &= ~(AC97C_CMR_CEM_LITTLE); 330 word &= ~(AC97C_CMR_CEM_LITTLE);
329 break; 331 break;
332 default:
333 word = ac97c_readl(chip, OCA);
334 word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));
335 ac97c_writel(chip, OCA, word);
336 return -EINVAL;
330 } 337 }
331 338
339 /* Enable underrun interrupt on channel A */
340 word |= AC97C_CSR_UNRUN;
341
332 ac97c_writel(chip, CAMR, word); 342 ac97c_writel(chip, CAMR, word);
333 343
344 /* Enable channel A event interrupt */
345 word = ac97c_readl(chip, IMR);
346 word |= AC97C_SR_CAEVT;
347 ac97c_writel(chip, IER, word);
348
334 /* set variable rate if needed */ 349 /* set variable rate if needed */
335 if (runtime->rate != 48000) { 350 if (runtime->rate != 48000) {
336 word = ac97c_readl(chip, MR); 351 word = ac97c_readl(chip, MR);
@@ -359,9 +374,11 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
359{ 374{
360 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); 375 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream);
361 struct snd_pcm_runtime *runtime = substream->runtime; 376 struct snd_pcm_runtime *runtime = substream->runtime;
362 unsigned long word = 0; 377 unsigned long word = ac97c_readl(chip, ICA);
363 int retval; 378 int retval;
364 379
380 word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));
381
365 /* assign channels to AC97C channel A */ 382 /* assign channels to AC97C channel A */
366 switch (runtime->channels) { 383 switch (runtime->channels) {
367 case 1: 384 case 1:
@@ -374,7 +391,6 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
374 default: 391 default:
375 /* TODO: support more than two channels */ 392 /* TODO: support more than two channels */
376 return -EINVAL; 393 return -EINVAL;
377 break;
378 } 394 }
379 ac97c_writel(chip, ICA, word); 395 ac97c_writel(chip, ICA, word);
380 396
@@ -386,13 +402,25 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
386 word |= AC97C_CMR_CEM_LITTLE; 402 word |= AC97C_CMR_CEM_LITTLE;
387 break; 403 break;
388 case SNDRV_PCM_FORMAT_S16_BE: /* fall through */ 404 case SNDRV_PCM_FORMAT_S16_BE: /* fall through */
389 default:
390 word &= ~(AC97C_CMR_CEM_LITTLE); 405 word &= ~(AC97C_CMR_CEM_LITTLE);
391 break; 406 break;
407 default:
408 word = ac97c_readl(chip, ICA);
409 word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT));
410 ac97c_writel(chip, ICA, word);
411 return -EINVAL;
392 } 412 }
393 413
414 /* Enable overrun interrupt on channel A */
415 word |= AC97C_CSR_OVRUN;
416
394 ac97c_writel(chip, CAMR, word); 417 ac97c_writel(chip, CAMR, word);
395 418
419 /* Enable channel A event interrupt */
420 word = ac97c_readl(chip, IMR);
421 word |= AC97C_SR_CAEVT;
422 ac97c_writel(chip, IER, word);
423
396 /* set variable rate if needed */ 424 /* set variable rate if needed */
397 if (runtime->rate != 48000) { 425 if (runtime->rate != 48000) {
398 word = ac97c_readl(chip, MR); 426 word = ac97c_readl(chip, MR);
@@ -543,6 +571,43 @@ static struct snd_pcm_ops atmel_ac97_capture_ops = {
543 .pointer = atmel_ac97c_capture_pointer, 571 .pointer = atmel_ac97c_capture_pointer,
544}; 572};
545 573
574static irqreturn_t atmel_ac97c_interrupt(int irq, void *dev)
575{
576 struct atmel_ac97c *chip = (struct atmel_ac97c *)dev;
577 irqreturn_t retval = IRQ_NONE;
578 u32 sr = ac97c_readl(chip, SR);
579 u32 casr = ac97c_readl(chip, CASR);
580 u32 cosr = ac97c_readl(chip, COSR);
581
582 if (sr & AC97C_SR_CAEVT) {
583 dev_info(&chip->pdev->dev, "channel A event%s%s%s%s%s%s\n",
584 casr & AC97C_CSR_OVRUN ? " OVRUN" : "",
585 casr & AC97C_CSR_RXRDY ? " RXRDY" : "",
586 casr & AC97C_CSR_UNRUN ? " UNRUN" : "",
587 casr & AC97C_CSR_TXEMPTY ? " TXEMPTY" : "",
588 casr & AC97C_CSR_TXRDY ? " TXRDY" : "",
589 !casr ? " NONE" : "");
590 retval = IRQ_HANDLED;
591 }
592
593 if (sr & AC97C_SR_COEVT) {
594 dev_info(&chip->pdev->dev, "codec channel event%s%s%s%s%s\n",
595 cosr & AC97C_CSR_OVRUN ? " OVRUN" : "",
596 cosr & AC97C_CSR_RXRDY ? " RXRDY" : "",
597 cosr & AC97C_CSR_TXEMPTY ? " TXEMPTY" : "",
598 cosr & AC97C_CSR_TXRDY ? " TXRDY" : "",
599 !cosr ? " NONE" : "");
600 retval = IRQ_HANDLED;
601 }
602
603 if (retval == IRQ_NONE) {
604 dev_err(&chip->pdev->dev, "spurious interrupt sr 0x%08x "
605 "casr 0x%08x cosr 0x%08x\n", sr, casr, cosr);
606 }
607
608 return retval;
609}
610
546static int __devinit atmel_ac97c_pcm_new(struct atmel_ac97c *chip) 611static int __devinit atmel_ac97c_pcm_new(struct atmel_ac97c *chip)
547{ 612{
548 struct snd_pcm *pcm; 613 struct snd_pcm *pcm;
@@ -665,17 +730,17 @@ static bool filter(struct dma_chan *chan, void *slave)
665 730
666static void atmel_ac97c_reset(struct atmel_ac97c *chip) 731static void atmel_ac97c_reset(struct atmel_ac97c *chip)
667{ 732{
668 ac97c_writel(chip, MR, AC97C_MR_WRST); 733 ac97c_writel(chip, MR, 0);
734 ac97c_writel(chip, MR, AC97C_MR_ENA);
735 ac97c_writel(chip, CAMR, 0);
736 ac97c_writel(chip, COMR, 0);
669 737
670 if (gpio_is_valid(chip->reset_pin)) { 738 if (gpio_is_valid(chip->reset_pin)) {
671 gpio_set_value(chip->reset_pin, 0); 739 gpio_set_value(chip->reset_pin, 0);
672 /* AC97 v2.2 specifications says minimum 1 us. */ 740 /* AC97 v2.2 specifications says minimum 1 us. */
673 udelay(10); 741 udelay(2);
674 gpio_set_value(chip->reset_pin, 1); 742 gpio_set_value(chip->reset_pin, 1);
675 } 743 }
676
677 udelay(1);
678 ac97c_writel(chip, MR, AC97C_MR_ENA);
679} 744}
680 745
681static int __devinit atmel_ac97c_probe(struct platform_device *pdev) 746static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
@@ -690,6 +755,7 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
690 .read = atmel_ac97c_read, 755 .read = atmel_ac97c_read,
691 }; 756 };
692 int retval; 757 int retval;
758 int irq;
693 759
694 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 760 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
695 if (!regs) { 761 if (!regs) {
@@ -703,6 +769,12 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
703 return -ENXIO; 769 return -ENXIO;
704 } 770 }
705 771
772 irq = platform_get_irq(pdev, 0);
773 if (irq < 0) {
774 dev_dbg(&pdev->dev, "could not get irq\n");
775 return -ENXIO;
776 }
777
706 pclk = clk_get(&pdev->dev, "pclk"); 778 pclk = clk_get(&pdev->dev, "pclk");
707 if (IS_ERR(pclk)) { 779 if (IS_ERR(pclk)) {
708 dev_dbg(&pdev->dev, "no peripheral clock\n"); 780 dev_dbg(&pdev->dev, "no peripheral clock\n");
@@ -719,6 +791,13 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
719 791
720 chip = get_chip(card); 792 chip = get_chip(card);
721 793
794 retval = request_irq(irq, atmel_ac97c_interrupt, 0, "AC97C", chip);
795 if (retval) {
796 dev_dbg(&pdev->dev, "unable to request irq %d\n", irq);
797 goto err_request_irq;
798 }
799 chip->irq = irq;
800
722 spin_lock_init(&chip->lock); 801 spin_lock_init(&chip->lock);
723 802
724 strcpy(card->driver, "Atmel AC97C"); 803 strcpy(card->driver, "Atmel AC97C");
@@ -747,14 +826,18 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
747 826
748 snd_card_set_dev(card, &pdev->dev); 827 snd_card_set_dev(card, &pdev->dev);
749 828
829 atmel_ac97c_reset(chip);
830
831 /* Enable overrun interrupt from codec channel */
832 ac97c_writel(chip, COMR, AC97C_CSR_OVRUN);
833 ac97c_writel(chip, IER, ac97c_readl(chip, IMR) | AC97C_SR_COEVT);
834
750 retval = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus); 835 retval = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus);
751 if (retval) { 836 if (retval) {
752 dev_dbg(&pdev->dev, "could not register on ac97 bus\n"); 837 dev_dbg(&pdev->dev, "could not register on ac97 bus\n");
753 goto err_ac97_bus; 838 goto err_ac97_bus;
754 } 839 }
755 840
756 atmel_ac97c_reset(chip);
757
758 retval = atmel_ac97c_mixer_new(chip); 841 retval = atmel_ac97c_mixer_new(chip);
759 if (retval) { 842 if (retval) {
760 dev_dbg(&pdev->dev, "could not register ac97 mixer\n"); 843 dev_dbg(&pdev->dev, "could not register ac97 mixer\n");
@@ -773,7 +856,7 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
773 chip->dma.rx_chan = dma_request_channel(mask, filter, dws); 856 chip->dma.rx_chan = dma_request_channel(mask, filter, dws);
774 857
775 dev_info(&chip->pdev->dev, "using %s for DMA RX\n", 858 dev_info(&chip->pdev->dev, "using %s for DMA RX\n",
776 chip->dma.rx_chan->dev->device.bus_id); 859 dev_name(&chip->dma.rx_chan->dev->device));
777 set_bit(DMA_RX_CHAN_PRESENT, &chip->flags); 860 set_bit(DMA_RX_CHAN_PRESENT, &chip->flags);
778 } 861 }
779 862
@@ -789,7 +872,7 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
789 chip->dma.tx_chan = dma_request_channel(mask, filter, dws); 872 chip->dma.tx_chan = dma_request_channel(mask, filter, dws);
790 873
791 dev_info(&chip->pdev->dev, "using %s for DMA TX\n", 874 dev_info(&chip->pdev->dev, "using %s for DMA TX\n",
792 chip->dma.tx_chan->dev->device.bus_id); 875 dev_name(&chip->dma.tx_chan->dev->device));
793 set_bit(DMA_TX_CHAN_PRESENT, &chip->flags); 876 set_bit(DMA_TX_CHAN_PRESENT, &chip->flags);
794 } 877 }
795 878
@@ -809,7 +892,7 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
809 retval = snd_card_register(card); 892 retval = snd_card_register(card);
810 if (retval) { 893 if (retval) {
811 dev_dbg(&pdev->dev, "could not register sound card\n"); 894 dev_dbg(&pdev->dev, "could not register sound card\n");
812 goto err_ac97_bus; 895 goto err_dma;
813 } 896 }
814 897
815 platform_set_drvdata(pdev, card); 898 platform_set_drvdata(pdev, card);
@@ -836,6 +919,8 @@ err_ac97_bus:
836 919
837 iounmap(chip->regs); 920 iounmap(chip->regs);
838err_ioremap: 921err_ioremap:
922 free_irq(irq, chip);
923err_request_irq:
839 snd_card_free(card); 924 snd_card_free(card);
840err_snd_card_new: 925err_snd_card_new:
841 clk_disable(pclk); 926 clk_disable(pclk);
@@ -884,9 +969,14 @@ static int __devexit atmel_ac97c_remove(struct platform_device *pdev)
884 if (gpio_is_valid(chip->reset_pin)) 969 if (gpio_is_valid(chip->reset_pin))
885 gpio_free(chip->reset_pin); 970 gpio_free(chip->reset_pin);
886 971
972 ac97c_writel(chip, CAMR, 0);
973 ac97c_writel(chip, COMR, 0);
974 ac97c_writel(chip, MR, 0);
975
887 clk_disable(chip->pclk); 976 clk_disable(chip->pclk);
888 clk_put(chip->pclk); 977 clk_put(chip->pclk);
889 iounmap(chip->regs); 978 iounmap(chip->regs);
979 free_irq(chip->irq, chip);
890 980
891 if (test_bit(DMA_RX_CHAN_PRESENT, &chip->flags)) 981 if (test_bit(DMA_RX_CHAN_PRESENT, &chip->flags))
892 dma_release_channel(chip->dma.rx_chan); 982 dma_release_channel(chip->dma.rx_chan);
diff --git a/sound/atmel/ac97c.h b/sound/atmel/ac97c.h
index c17bd5825980..ecbba5021c80 100644
--- a/sound/atmel/ac97c.h
+++ b/sound/atmel/ac97c.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Register definitions for the Atmel AC97C controller 2 * Register definitions for Atmel AC97C
3 * 3 *
4 * Copyright (C) 2005-2009 Atmel Corporation 4 * Copyright (C) 2005-2009 Atmel Corporation
5 * 5 *
@@ -17,10 +17,6 @@
17#define AC97C_CATHR 0x24 17#define AC97C_CATHR 0x24
18#define AC97C_CASR 0x28 18#define AC97C_CASR 0x28
19#define AC97C_CAMR 0x2c 19#define AC97C_CAMR 0x2c
20#define AC97C_CBRHR 0x30
21#define AC97C_CBTHR 0x34
22#define AC97C_CBSR 0x38
23#define AC97C_CBMR 0x3c
24#define AC97C_CORHR 0x40 20#define AC97C_CORHR 0x40
25#define AC97C_COTHR 0x44 21#define AC97C_COTHR 0x44
26#define AC97C_COSR 0x48 22#define AC97C_COSR 0x48
@@ -46,8 +42,10 @@
46#define AC97C_MR_VRA (1 << 2) 42#define AC97C_MR_VRA (1 << 2)
47 43
48#define AC97C_CSR_TXRDY (1 << 0) 44#define AC97C_CSR_TXRDY (1 << 0)
45#define AC97C_CSR_TXEMPTY (1 << 1)
49#define AC97C_CSR_UNRUN (1 << 2) 46#define AC97C_CSR_UNRUN (1 << 2)
50#define AC97C_CSR_RXRDY (1 << 4) 47#define AC97C_CSR_RXRDY (1 << 4)
48#define AC97C_CSR_OVRUN (1 << 5)
51#define AC97C_CSR_ENDTX (1 << 10) 49#define AC97C_CSR_ENDTX (1 << 10)
52#define AC97C_CSR_ENDRX (1 << 14) 50#define AC97C_CSR_ENDRX (1 << 14)
53 51
@@ -61,11 +59,15 @@
61#define AC97C_CMR_DMAEN (1 << 22) 59#define AC97C_CMR_DMAEN (1 << 22)
62 60
63#define AC97C_SR_CAEVT (1 << 3) 61#define AC97C_SR_CAEVT (1 << 3)
62#define AC97C_SR_COEVT (1 << 2)
63#define AC97C_SR_WKUP (1 << 1)
64#define AC97C_SR_SOF (1 << 0)
64 65
66#define AC97C_CH_MASK(slot) \
67 (0x7 << (3 * (AC97_SLOT_##slot - 3)))
65#define AC97C_CH_ASSIGN(slot, channel) \ 68#define AC97C_CH_ASSIGN(slot, channel) \
66 (AC97C_CHANNEL_##channel << (3 * (AC97_SLOT_##slot - 3))) 69 (AC97C_CHANNEL_##channel << (3 * (AC97_SLOT_##slot - 3)))
67#define AC97C_CHANNEL_NONE 0x0 70#define AC97C_CHANNEL_NONE 0x0
68#define AC97C_CHANNEL_A 0x1 71#define AC97C_CHANNEL_A 0x1
69#define AC97C_CHANNEL_B 0x2
70 72
71#endif /* __SOUND_ATMEL_AC97C_H */ 73#endif /* __SOUND_ATMEL_AC97C_H */
diff --git a/sound/core/control.c b/sound/core/control.c
index 4b20fa2b7e6d..17b8d47a5cd0 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -723,14 +723,11 @@ static int snd_ctl_elem_read_user(struct snd_card *card,
723{ 723{
724 struct snd_ctl_elem_value *control; 724 struct snd_ctl_elem_value *control;
725 int result; 725 int result;
726 726
727 control = kmalloc(sizeof(*control), GFP_KERNEL); 727 control = memdup_user(_control, sizeof(*control));
728 if (control == NULL) 728 if (IS_ERR(control))
729 return -ENOMEM; 729 return PTR_ERR(control);
730 if (copy_from_user(control, _control, sizeof(*control))) { 730
731 kfree(control);
732 return -EFAULT;
733 }
734 snd_power_lock(card); 731 snd_power_lock(card);
735 result = snd_power_wait(card, SNDRV_CTL_POWER_D0); 732 result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
736 if (result >= 0) 733 if (result >= 0)
@@ -784,13 +781,10 @@ static int snd_ctl_elem_write_user(struct snd_ctl_file *file,
784 struct snd_card *card; 781 struct snd_card *card;
785 int result; 782 int result;
786 783
787 control = kmalloc(sizeof(*control), GFP_KERNEL); 784 control = memdup_user(_control, sizeof(*control));
788 if (control == NULL) 785 if (IS_ERR(control))
789 return -ENOMEM; 786 return PTR_ERR(control);
790 if (copy_from_user(control, _control, sizeof(*control))) { 787
791 kfree(control);
792 return -EFAULT;
793 }
794 card = file->card; 788 card = file->card;
795 snd_power_lock(card); 789 snd_power_lock(card);
796 result = snd_power_wait(card, SNDRV_CTL_POWER_D0); 790 result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
@@ -916,13 +910,10 @@ static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol,
916 if (op_flag > 0) { 910 if (op_flag > 0) {
917 if (size > 1024 * 128) /* sane value */ 911 if (size > 1024 * 128) /* sane value */
918 return -EINVAL; 912 return -EINVAL;
919 new_data = kmalloc(size, GFP_KERNEL); 913
920 if (new_data == NULL) 914 new_data = memdup_user(tlv, size);
921 return -ENOMEM; 915 if (IS_ERR(new_data))
922 if (copy_from_user(new_data, tlv, size)) { 916 return PTR_ERR(new_data);
923 kfree(new_data);
924 return -EFAULT;
925 }
926 change = ue->tlv_data_size != size; 917 change = ue->tlv_data_size != size;
927 if (!change) 918 if (!change)
928 change = memcmp(ue->tlv_data, new_data, size); 919 change = memcmp(ue->tlv_data, new_data, size);
diff --git a/sound/core/jack.c b/sound/core/jack.c
index c8254c667c62..d54d1a05fe65 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -35,6 +35,9 @@ static int snd_jack_dev_free(struct snd_device *device)
35{ 35{
36 struct snd_jack *jack = device->device_data; 36 struct snd_jack *jack = device->device_data;
37 37
38 if (jack->private_free)
39 jack->private_free(jack);
40
38 /* If the input device is registered with the input subsystem 41 /* If the input device is registered with the input subsystem
39 * then we need to use a different deallocator. */ 42 * then we need to use a different deallocator. */
40 if (jack->registered) 43 if (jack->registered)
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index e570649184e2..5dcd8a526970 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -703,19 +703,27 @@ static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer,
703 if (left || right) { 703 if (left || right) {
704 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) 704 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH)
705 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0); 705 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
706 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CSWITCH)
707 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], left, right, 0);
706 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) 708 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH)
707 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0); 709 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
708 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) 710 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE)
709 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1); 711 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
712 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CROUTE)
713 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], left, right, 1);
710 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) 714 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE)
711 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1); 715 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
712 } else { 716 } else {
713 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) { 717 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) {
714 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0); 718 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0);
719 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CSWITCH) {
720 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], left, right, 0);
715 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) { 721 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) {
716 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0); 722 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0);
717 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) { 723 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) {
718 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1); 724 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1);
725 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CROUTE) {
726 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], left, right, 1);
719 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) { 727 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) {
720 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1); 728 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
721 } 729 }
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index 36d7a5998234..08bfed594a83 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -232,14 +232,11 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,
232 if (! (runtime = substream->runtime)) 232 if (! (runtime = substream->runtime))
233 return -ENOTTY; 233 return -ENOTTY;
234 234
235 data = kmalloc(sizeof(*data), GFP_KERNEL);
236 if (data == NULL)
237 return -ENOMEM;
238 /* only fifo_size is different, so just copy all */ 235 /* only fifo_size is different, so just copy all */
239 if (copy_from_user(data, data32, sizeof(*data32))) { 236 data = memdup_user(data32, sizeof(*data32));
240 err = -EFAULT; 237 if (IS_ERR(data))
241 goto error; 238 return PTR_ERR(data);
242 } 239
243 if (refine) 240 if (refine)
244 err = snd_pcm_hw_refine(substream, data); 241 err = snd_pcm_hw_refine(substream, data);
245 else 242 else
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index fbb2e391591e..63d088f2265f 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -209,9 +209,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
209{ 209{
210 struct snd_pcm_runtime *runtime = substream->runtime; 210 struct snd_pcm_runtime *runtime = substream->runtime;
211 snd_pcm_uframes_t pos; 211 snd_pcm_uframes_t pos;
212 snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt, hw_base; 212 snd_pcm_uframes_t old_hw_ptr, new_hw_ptr, hw_ptr_interrupt, hw_base;
213 snd_pcm_sframes_t delta; 213 snd_pcm_sframes_t hdelta, delta;
214 unsigned long jdelta;
214 215
216 old_hw_ptr = runtime->status->hw_ptr;
215 pos = snd_pcm_update_hw_ptr_pos(substream, runtime); 217 pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
216 if (pos == SNDRV_PCM_POS_XRUN) { 218 if (pos == SNDRV_PCM_POS_XRUN) {
217 xrun(substream); 219 xrun(substream);
@@ -247,7 +249,30 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
247 new_hw_ptr = hw_base + pos; 249 new_hw_ptr = hw_base + pos;
248 } 250 }
249 } 251 }
250 if (delta > runtime->period_size) { 252 hdelta = new_hw_ptr - old_hw_ptr;
253 jdelta = jiffies - runtime->hw_ptr_jiffies;
254 if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) {
255 delta = jdelta /
256 (((runtime->period_size * HZ) / runtime->rate)
257 + HZ/100);
258 hw_ptr_error(substream,
259 "hw_ptr skipping! [Q] "
260 "(pos=%ld, delta=%ld, period=%ld, "
261 "jdelta=%lu/%lu/%lu)\n",
262 (long)pos, (long)hdelta,
263 (long)runtime->period_size, jdelta,
264 ((hdelta * HZ) / runtime->rate), delta);
265 hw_ptr_interrupt = runtime->hw_ptr_interrupt +
266 runtime->period_size * delta;
267 if (hw_ptr_interrupt >= runtime->boundary)
268 hw_ptr_interrupt -= runtime->boundary;
269 /* rebase to interrupt position */
270 hw_base = new_hw_ptr = hw_ptr_interrupt;
271 /* align hw_base to buffer_size */
272 hw_base -= hw_base % runtime->buffer_size;
273 delta = 0;
274 }
275 if (delta > runtime->period_size + runtime->period_size / 2) {
251 hw_ptr_error(substream, 276 hw_ptr_error(substream,
252 "Lost interrupts? " 277 "Lost interrupts? "
253 "(stream=%i, delta=%ld, intr_ptr=%ld)\n", 278 "(stream=%i, delta=%ld, intr_ptr=%ld)\n",
@@ -263,6 +288,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
263 288
264 runtime->hw_ptr_base = hw_base; 289 runtime->hw_ptr_base = hw_base;
265 runtime->status->hw_ptr = new_hw_ptr; 290 runtime->status->hw_ptr = new_hw_ptr;
291 runtime->hw_ptr_jiffies = jiffies;
266 runtime->hw_ptr_interrupt = hw_ptr_interrupt; 292 runtime->hw_ptr_interrupt = hw_ptr_interrupt;
267 293
268 return snd_pcm_update_hw_ptr_post(substream, runtime); 294 return snd_pcm_update_hw_ptr_post(substream, runtime);
@@ -275,6 +301,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
275 snd_pcm_uframes_t pos; 301 snd_pcm_uframes_t pos;
276 snd_pcm_uframes_t old_hw_ptr, new_hw_ptr, hw_base; 302 snd_pcm_uframes_t old_hw_ptr, new_hw_ptr, hw_base;
277 snd_pcm_sframes_t delta; 303 snd_pcm_sframes_t delta;
304 unsigned long jdelta;
278 305
279 old_hw_ptr = runtime->status->hw_ptr; 306 old_hw_ptr = runtime->status->hw_ptr;
280 pos = snd_pcm_update_hw_ptr_pos(substream, runtime); 307 pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
@@ -286,14 +313,15 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
286 new_hw_ptr = hw_base + pos; 313 new_hw_ptr = hw_base + pos;
287 314
288 delta = new_hw_ptr - old_hw_ptr; 315 delta = new_hw_ptr - old_hw_ptr;
316 jdelta = jiffies - runtime->hw_ptr_jiffies;
289 if (delta < 0) { 317 if (delta < 0) {
290 delta += runtime->buffer_size; 318 delta += runtime->buffer_size;
291 if (delta < 0) { 319 if (delta < 0) {
292 hw_ptr_error(substream, 320 hw_ptr_error(substream,
293 "Unexpected hw_pointer value [2] " 321 "Unexpected hw_pointer value [2] "
294 "(stream=%i, pos=%ld, old_ptr=%ld)\n", 322 "(stream=%i, pos=%ld, old_ptr=%ld, jdelta=%li)\n",
295 substream->stream, (long)pos, 323 substream->stream, (long)pos,
296 (long)old_hw_ptr); 324 (long)old_hw_ptr, jdelta);
297 return 0; 325 return 0;
298 } 326 }
299 hw_base += runtime->buffer_size; 327 hw_base += runtime->buffer_size;
@@ -301,12 +329,13 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
301 hw_base = 0; 329 hw_base = 0;
302 new_hw_ptr = hw_base + pos; 330 new_hw_ptr = hw_base + pos;
303 } 331 }
304 if (delta > runtime->period_size && runtime->periods > 1) { 332 if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
305 hw_ptr_error(substream, 333 hw_ptr_error(substream,
306 "hw_ptr skipping! " 334 "hw_ptr skipping! "
307 "(pos=%ld, delta=%ld, period=%ld)\n", 335 "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",
308 (long)pos, (long)delta, 336 (long)pos, (long)delta,
309 (long)runtime->period_size); 337 (long)runtime->period_size, jdelta,
338 ((delta * HZ) / runtime->rate));
310 return 0; 339 return 0;
311 } 340 }
312 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 341 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
@@ -315,6 +344,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
315 344
316 runtime->hw_ptr_base = hw_base; 345 runtime->hw_ptr_base = hw_base;
317 runtime->status->hw_ptr = new_hw_ptr; 346 runtime->status->hw_ptr = new_hw_ptr;
347 runtime->hw_ptr_jiffies = jiffies;
318 348
319 return snd_pcm_update_hw_ptr_post(substream, runtime); 349 return snd_pcm_update_hw_ptr_post(substream, runtime);
320} 350}
@@ -1441,6 +1471,7 @@ static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream,
1441 runtime->status->hw_ptr %= runtime->buffer_size; 1471 runtime->status->hw_ptr %= runtime->buffer_size;
1442 else 1472 else
1443 runtime->status->hw_ptr = 0; 1473 runtime->status->hw_ptr = 0;
1474 runtime->hw_ptr_jiffies = jiffies;
1444 snd_pcm_stream_unlock_irqrestore(substream, flags); 1475 snd_pcm_stream_unlock_irqrestore(substream, flags);
1445 return 0; 1476 return 0;
1446} 1477}
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index a151fb01ba82..fc6f98e257df 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -327,21 +327,16 @@ static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
327 struct snd_pcm_hw_params *params; 327 struct snd_pcm_hw_params *params;
328 int err; 328 int err;
329 329
330 params = kmalloc(sizeof(*params), GFP_KERNEL); 330 params = memdup_user(_params, sizeof(*params));
331 if (!params) { 331 if (IS_ERR(params))
332 err = -ENOMEM; 332 return PTR_ERR(params);
333 goto out; 333
334 }
335 if (copy_from_user(params, _params, sizeof(*params))) {
336 err = -EFAULT;
337 goto out;
338 }
339 err = snd_pcm_hw_refine(substream, params); 334 err = snd_pcm_hw_refine(substream, params);
340 if (copy_to_user(_params, params, sizeof(*params))) { 335 if (copy_to_user(_params, params, sizeof(*params))) {
341 if (!err) 336 if (!err)
342 err = -EFAULT; 337 err = -EFAULT;
343 } 338 }
344out: 339
345 kfree(params); 340 kfree(params);
346 return err; 341 return err;
347} 342}
@@ -465,21 +460,16 @@ static int snd_pcm_hw_params_user(struct snd_pcm_substream *substream,
465 struct snd_pcm_hw_params *params; 460 struct snd_pcm_hw_params *params;
466 int err; 461 int err;
467 462
468 params = kmalloc(sizeof(*params), GFP_KERNEL); 463 params = memdup_user(_params, sizeof(*params));
469 if (!params) { 464 if (IS_ERR(params))
470 err = -ENOMEM; 465 return PTR_ERR(params);
471 goto out; 466
472 }
473 if (copy_from_user(params, _params, sizeof(*params))) {
474 err = -EFAULT;
475 goto out;
476 }
477 err = snd_pcm_hw_params(substream, params); 467 err = snd_pcm_hw_params(substream, params);
478 if (copy_to_user(_params, params, sizeof(*params))) { 468 if (copy_to_user(_params, params, sizeof(*params))) {
479 if (!err) 469 if (!err)
480 err = -EFAULT; 470 err = -EFAULT;
481 } 471 }
482out: 472
483 kfree(params); 473 kfree(params);
484 return err; 474 return err;
485} 475}
@@ -2593,13 +2583,11 @@ static int snd_pcm_playback_ioctl1(struct file *file,
2593 return -EFAULT; 2583 return -EFAULT;
2594 if (copy_from_user(&xfern, _xfern, sizeof(xfern))) 2584 if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
2595 return -EFAULT; 2585 return -EFAULT;
2596 bufs = kmalloc(sizeof(void *) * runtime->channels, GFP_KERNEL); 2586
2597 if (bufs == NULL) 2587 bufs = memdup_user(xfern.bufs,
2598 return -ENOMEM; 2588 sizeof(void *) * runtime->channels);
2599 if (copy_from_user(bufs, xfern.bufs, sizeof(void *) * runtime->channels)) { 2589 if (IS_ERR(bufs))
2600 kfree(bufs); 2590 return PTR_ERR(bufs);
2601 return -EFAULT;
2602 }
2603 result = snd_pcm_lib_writev(substream, bufs, xfern.frames); 2591 result = snd_pcm_lib_writev(substream, bufs, xfern.frames);
2604 kfree(bufs); 2592 kfree(bufs);
2605 __put_user(result, &_xfern->result); 2593 __put_user(result, &_xfern->result);
@@ -2675,13 +2663,11 @@ static int snd_pcm_capture_ioctl1(struct file *file,
2675 return -EFAULT; 2663 return -EFAULT;
2676 if (copy_from_user(&xfern, _xfern, sizeof(xfern))) 2664 if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
2677 return -EFAULT; 2665 return -EFAULT;
2678 bufs = kmalloc(sizeof(void *) * runtime->channels, GFP_KERNEL); 2666
2679 if (bufs == NULL) 2667 bufs = memdup_user(xfern.bufs,
2680 return -ENOMEM; 2668 sizeof(void *) * runtime->channels);
2681 if (copy_from_user(bufs, xfern.bufs, sizeof(void *) * runtime->channels)) { 2669 if (IS_ERR(bufs))
2682 kfree(bufs); 2670 return PTR_ERR(bufs);
2683 return -EFAULT;
2684 }
2685 result = snd_pcm_lib_readv(substream, bufs, xfern.frames); 2671 result = snd_pcm_lib_readv(substream, bufs, xfern.frames);
2686 kfree(bufs); 2672 kfree(bufs);
2687 __put_user(result, &_xfern->result); 2673 __put_user(result, &_xfern->result);
@@ -3312,18 +3298,12 @@ static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
3312 int err; 3298 int err;
3313 3299
3314 params = kmalloc(sizeof(*params), GFP_KERNEL); 3300 params = kmalloc(sizeof(*params), GFP_KERNEL);
3315 if (!params) { 3301 if (!params)
3316 err = -ENOMEM; 3302 return -ENOMEM;
3317 goto out;
3318 }
3319 oparams = kmalloc(sizeof(*oparams), GFP_KERNEL);
3320 if (!oparams) {
3321 err = -ENOMEM;
3322 goto out;
3323 }
3324 3303
3325 if (copy_from_user(oparams, _oparams, sizeof(*oparams))) { 3304 oparams = memdup_user(_oparams, sizeof(*oparams));
3326 err = -EFAULT; 3305 if (IS_ERR(oparams)) {
3306 err = PTR_ERR(oparams);
3327 goto out; 3307 goto out;
3328 } 3308 }
3329 snd_pcm_hw_convert_from_old_params(params, oparams); 3309 snd_pcm_hw_convert_from_old_params(params, oparams);
@@ -3333,9 +3313,10 @@ static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
3333 if (!err) 3313 if (!err)
3334 err = -EFAULT; 3314 err = -EFAULT;
3335 } 3315 }
3316
3317 kfree(oparams);
3336out: 3318out:
3337 kfree(params); 3319 kfree(params);
3338 kfree(oparams);
3339 return err; 3320 return err;
3340} 3321}
3341 3322
@@ -3347,17 +3328,12 @@ static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
3347 int err; 3328 int err;
3348 3329
3349 params = kmalloc(sizeof(*params), GFP_KERNEL); 3330 params = kmalloc(sizeof(*params), GFP_KERNEL);
3350 if (!params) { 3331 if (!params)
3351 err = -ENOMEM; 3332 return -ENOMEM;
3352 goto out; 3333
3353 } 3334 oparams = memdup_user(_oparams, sizeof(*oparams));
3354 oparams = kmalloc(sizeof(*oparams), GFP_KERNEL); 3335 if (IS_ERR(oparams)) {
3355 if (!oparams) { 3336 err = PTR_ERR(oparams);
3356 err = -ENOMEM;
3357 goto out;
3358 }
3359 if (copy_from_user(oparams, _oparams, sizeof(*oparams))) {
3360 err = -EFAULT;
3361 goto out; 3337 goto out;
3362 } 3338 }
3363 snd_pcm_hw_convert_from_old_params(params, oparams); 3339 snd_pcm_hw_convert_from_old_params(params, oparams);
@@ -3367,9 +3343,10 @@ static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
3367 if (!err) 3343 if (!err)
3368 err = -EFAULT; 3344 err = -EFAULT;
3369 } 3345 }
3346
3347 kfree(oparams);
3370out: 3348out:
3371 kfree(params); 3349 kfree(params);
3372 kfree(oparams);
3373 return err; 3350 return err;
3374} 3351}
3375#endif /* CONFIG_SND_SUPPORT_OLD_API */ 3352#endif /* CONFIG_SND_SUPPORT_OLD_API */
diff --git a/sound/core/seq/seq_compat.c b/sound/core/seq/seq_compat.c
index 38693f47c262..c956fe462569 100644
--- a/sound/core/seq/seq_compat.c
+++ b/sound/core/seq/seq_compat.c
@@ -48,12 +48,11 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned
48 struct snd_seq_port_info *data; 48 struct snd_seq_port_info *data;
49 mm_segment_t fs; 49 mm_segment_t fs;
50 50
51 data = kmalloc(sizeof(*data), GFP_KERNEL); 51 data = memdup_user(data32, sizeof(*data32));
52 if (! data) 52 if (IS_ERR(data))
53 return -ENOMEM; 53 return PTR_ERR(data);
54 54
55 if (copy_from_user(data, data32, sizeof(*data32)) || 55 if (get_user(data->flags, &data32->flags) ||
56 get_user(data->flags, &data32->flags) ||
57 get_user(data->time_queue, &data32->time_queue)) 56 get_user(data->time_queue, &data32->time_queue))
58 goto error; 57 goto error;
59 data->kernel = NULL; 58 data->kernel = NULL;
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 3f0050d0b71e..8f8b17ac074d 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1395,13 +1395,10 @@ static int snd_timer_user_ginfo(struct file *file,
1395 struct list_head *p; 1395 struct list_head *p;
1396 int err = 0; 1396 int err = 0;
1397 1397
1398 ginfo = kmalloc(sizeof(*ginfo), GFP_KERNEL); 1398 ginfo = memdup_user(_ginfo, sizeof(*ginfo));
1399 if (! ginfo) 1399 if (IS_ERR(ginfo))
1400 return -ENOMEM; 1400 return PTR_ERR(ginfo);
1401 if (copy_from_user(ginfo, _ginfo, sizeof(*ginfo))) { 1401
1402 kfree(ginfo);
1403 return -EFAULT;
1404 }
1405 tid = ginfo->tid; 1402 tid = ginfo->tid;
1406 memset(ginfo, 0, sizeof(*ginfo)); 1403 memset(ginfo, 0, sizeof(*ginfo));
1407 ginfo->tid = tid; 1404 ginfo->tid = tid;
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
index c5c9a9218ff6..c6942a4de99b 100644
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -395,16 +395,6 @@ config SND_WAVEFRONT
395 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
396 will be called snd-wavefront. 396 will be called snd-wavefront.
397 397
398config SND_WAVEFRONT_FIRMWARE_IN_KERNEL
399 bool "In-kernel firmware for Wavefront"
400 depends on SND_WAVEFRONT
401 default y
402 help
403 Say Y here to include the static firmware for FX DSP built in
404 the kernel for the Wavefront driver. If you choose N here,
405 you need to install the firmware files from the
406 alsa-firmware package.
407
408config SND_MSND_PINNACLE 398config SND_MSND_PINNACLE
409 tristate "Turtle Beach MultiSound Pinnacle/Fiji driver" 399 tristate "Turtle Beach MultiSound Pinnacle/Fiji driver"
410 depends on X86 && EXPERIMENTAL 400 depends on X86 && EXPERIMENTAL
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index ef95279da7a3..0481a55334b9 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -481,6 +481,7 @@ OPL3SA2_DOUBLE_TLV("Master Playback Volume", 0, 0x07, 0x08, 0, 0, 15, 1,
481OPL3SA2_SINGLE("Mic Playback Switch", 0, 0x09, 7, 1, 1), 481OPL3SA2_SINGLE("Mic Playback Switch", 0, 0x09, 7, 1, 1),
482OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, 482OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1,
483 db_scale_5bit_12db_max), 483 db_scale_5bit_12db_max),
484OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0),
484}; 485};
485 486
486static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = { 487static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = {
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/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 beb312cca75b..5d4ff48c4345 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -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/pci/ad1889.c b/sound/pci/ad1889.c
index d1f242bd0ac5..8f5098f92c37 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -909,8 +909,8 @@ snd_ad1889_create(struct snd_card *card,
909 return err; 909 return err;
910 910
911 /* check PCI availability (32bit DMA) */ 911 /* check PCI availability (32bit DMA) */
912 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 || 912 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
913 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) { 913 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
914 printk(KERN_ERR PFX "error setting 32-bit DMA mask.\n"); 914 printk(KERN_ERR PFX "error setting 32-bit DMA mask.\n");
915 pci_disable_device(pci); 915 pci_disable_device(pci);
916 return -ENXIO; 916 return -ENXIO;
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 4edf270a7809..c551006e2920 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -2186,8 +2186,8 @@ static int __devinit snd_ali_create(struct snd_card *card,
2186 if (err < 0) 2186 if (err < 0)
2187 return err; 2187 return err;
2188 /* check, if we can restrict PCI DMA transfers to 31 bits */ 2188 /* check, if we can restrict PCI DMA transfers to 31 bits */
2189 if (pci_set_dma_mask(pci, DMA_31BIT_MASK) < 0 || 2189 if (pci_set_dma_mask(pci, DMA_BIT_MASK(31)) < 0 ||
2190 pci_set_consistent_dma_mask(pci, DMA_31BIT_MASK) < 0) { 2190 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(31)) < 0) {
2191 snd_printk(KERN_ERR "architecture does not support " 2191 snd_printk(KERN_ERR "architecture does not support "
2192 "31bit PCI busmaster DMA\n"); 2192 "31bit PCI busmaster DMA\n");
2193 pci_disable_device(pci); 2193 pci_disable_device(pci);
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 009b4c8225a5..3aa35af7ca91 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -689,8 +689,8 @@ static int __devinit snd_als300_create(struct snd_card *card,
689 if ((err = pci_enable_device(pci)) < 0) 689 if ((err = pci_enable_device(pci)) < 0)
690 return err; 690 return err;
691 691
692 if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || 692 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
693 pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { 693 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
694 printk(KERN_ERR "error setting 28bit DMA mask\n"); 694 printk(KERN_ERR "error setting 28bit DMA mask\n");
695 pci_disable_device(pci); 695 pci_disable_device(pci);
696 return -ENXIO; 696 return -ENXIO;
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 542a0c65a92c..3dbacde1a5af 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -872,8 +872,8 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
872 return err; 872 return err;
873 } 873 }
874 /* check, if we can restrict PCI DMA transfers to 24 bits */ 874 /* check, if we can restrict PCI DMA transfers to 24 bits */
875 if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || 875 if (pci_set_dma_mask(pci, DMA_BIT_MASK(24)) < 0 ||
876 pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { 876 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(24)) < 0) {
877 snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); 877 snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n");
878 pci_disable_device(pci); 878 pci_disable_device(pci);
879 return -ENXIO; 879 return -ENXIO;
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 9ec122383eef..7b72c88e449d 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -151,8 +151,8 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
151 // check PCI availability (DMA). 151 // check PCI availability (DMA).
152 if ((err = pci_enable_device(pci)) < 0) 152 if ((err = pci_enable_device(pci)) < 0)
153 return err; 153 return err;
154 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 || 154 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
155 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) { 155 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
156 printk(KERN_ERR "error to set DMA mask\n"); 156 printk(KERN_ERR "error to set DMA mask\n");
157 pci_disable_device(pci); 157 pci_disable_device(pci);
158 return -ENXIO; 158 return -ENXIO;
diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c
index 8eea29fc42fe..4d34bb0d99d3 100644
--- a/sound/pci/aw2/aw2-alsa.c
+++ b/sound/pci/aw2/aw2-alsa.c
@@ -279,8 +279,8 @@ static int __devinit snd_aw2_create(struct snd_card *card,
279 pci_set_master(pci); 279 pci_set_master(pci);
280 280
281 /* check PCI availability (32bit DMA) */ 281 /* check PCI availability (32bit DMA) */
282 if ((pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) || 282 if ((pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) ||
283 (pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0)) { 283 (pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0)) {
284 printk(KERN_ERR "aw2: Impossible to set 32bit mask DMA\n"); 284 printk(KERN_ERR "aw2: Impossible to set 32bit mask DMA\n");
285 pci_disable_device(pci); 285 pci_disable_device(pci);
286 return -ENXIO; 286 return -ENXIO;
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index e9e9b5821d41..f290bc56178f 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -2125,8 +2125,8 @@ snd_azf3328_create(struct snd_card *card,
2125 chip->irq = -1; 2125 chip->irq = -1;
2126 2126
2127 /* check if we can restrict PCI DMA transfers to 24 bits */ 2127 /* check if we can restrict PCI DMA transfers to 24 bits */
2128 if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || 2128 if (pci_set_dma_mask(pci, DMA_BIT_MASK(24)) < 0 ||
2129 pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { 2129 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(24)) < 0) {
2130 snd_printk(KERN_ERR "architecture does not support " 2130 snd_printk(KERN_ERR "architecture does not support "
2131 "24bit PCI busmaster DMA\n" 2131 "24bit PCI busmaster DMA\n"
2132 ); 2132 );
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index df757575798a..bfac30f7929f 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1589,8 +1589,8 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
1589 err = pci_enable_device(pci); 1589 err = pci_enable_device(pci);
1590 if (err < 0) 1590 if (err < 0)
1591 return err; 1591 return err;
1592 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 || 1592 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
1593 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) { 1593 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
1594 printk(KERN_ERR "error to set 32bit mask DMA\n"); 1594 printk(KERN_ERR "error to set 32bit mask DMA\n");
1595 pci_disable_device(pci); 1595 pci_disable_device(pci);
1596 return -ENXIO; 1596 return -ENXIO;
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index c89ed1f5bc2b..05f56e04849b 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -285,8 +285,8 @@ static int __devinit snd_cs5535audio_create(struct snd_card *card,
285 if ((err = pci_enable_device(pci)) < 0) 285 if ((err = pci_enable_device(pci)) < 0)
286 return err; 286 return err;
287 287
288 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 || 288 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
289 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) { 289 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
290 printk(KERN_WARNING "unable to get 32bit dma\n"); 290 printk(KERN_WARNING "unable to get 32bit dma\n");
291 err = -ENXIO; 291 err = -ENXIO;
292 goto pcifail; 292 goto pcifail;
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 31542adc6b7e..1970f0e70f37 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -897,8 +897,8 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
897 897
898 if ((err = pci_enable_device(pci)) < 0) 898 if ((err = pci_enable_device(pci)) < 0)
899 return err; 899 return err;
900 if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || 900 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
901 pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { 901 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
902 snd_printk(KERN_ERR "error to set 28bit mask DMA\n"); 902 snd_printk(KERN_ERR "error to set 28bit mask DMA\n");
903 pci_disable_device(pci); 903 pci_disable_device(pci);
904 return -ENXIO; 904 return -ENXIO;
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 191e1cd9997d..4b302d86f5f2 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -2493,24 +2493,17 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
2493 case SNDRV_EMU10K1_IOCTL_CODE_POKE: 2493 case SNDRV_EMU10K1_IOCTL_CODE_POKE:
2494 if (!capable(CAP_SYS_ADMIN)) 2494 if (!capable(CAP_SYS_ADMIN))
2495 return -EPERM; 2495 return -EPERM;
2496 icode = kmalloc(sizeof(*icode), GFP_KERNEL); 2496
2497 if (icode == NULL) 2497 icode = memdup_user(argp, sizeof(*icode));
2498 return -ENOMEM; 2498 if (IS_ERR(icode))
2499 if (copy_from_user(icode, argp, sizeof(*icode))) { 2499 return PTR_ERR(icode);
2500 kfree(icode);
2501 return -EFAULT;
2502 }
2503 res = snd_emu10k1_icode_poke(emu, icode); 2500 res = snd_emu10k1_icode_poke(emu, icode);
2504 kfree(icode); 2501 kfree(icode);
2505 return res; 2502 return res;
2506 case SNDRV_EMU10K1_IOCTL_CODE_PEEK: 2503 case SNDRV_EMU10K1_IOCTL_CODE_PEEK:
2507 icode = kmalloc(sizeof(*icode), GFP_KERNEL); 2504 icode = memdup_user(argp, sizeof(*icode));
2508 if (icode == NULL) 2505 if (IS_ERR(icode))
2509 return -ENOMEM; 2506 return PTR_ERR(icode);
2510 if (copy_from_user(icode, argp, sizeof(*icode))) {
2511 kfree(icode);
2512 return -EFAULT;
2513 }
2514 res = snd_emu10k1_icode_peek(emu, icode); 2507 res = snd_emu10k1_icode_peek(emu, icode);
2515 if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) { 2508 if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) {
2516 kfree(icode); 2509 kfree(icode);
@@ -2519,24 +2512,16 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
2519 kfree(icode); 2512 kfree(icode);
2520 return res; 2513 return res;
2521 case SNDRV_EMU10K1_IOCTL_PCM_POKE: 2514 case SNDRV_EMU10K1_IOCTL_PCM_POKE:
2522 ipcm = kmalloc(sizeof(*ipcm), GFP_KERNEL); 2515 ipcm = memdup_user(argp, sizeof(*ipcm));
2523 if (ipcm == NULL) 2516 if (IS_ERR(ipcm))
2524 return -ENOMEM; 2517 return PTR_ERR(ipcm);
2525 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
2526 kfree(ipcm);
2527 return -EFAULT;
2528 }
2529 res = snd_emu10k1_ipcm_poke(emu, ipcm); 2518 res = snd_emu10k1_ipcm_poke(emu, ipcm);
2530 kfree(ipcm); 2519 kfree(ipcm);
2531 return res; 2520 return res;
2532 case SNDRV_EMU10K1_IOCTL_PCM_PEEK: 2521 case SNDRV_EMU10K1_IOCTL_PCM_PEEK:
2533 ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL); 2522 ipcm = memdup_user(argp, sizeof(*ipcm));
2534 if (ipcm == NULL) 2523 if (IS_ERR(ipcm))
2535 return -ENOMEM; 2524 return PTR_ERR(ipcm);
2536 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
2537 kfree(ipcm);
2538 return -EFAULT;
2539 }
2540 res = snd_emu10k1_ipcm_peek(emu, ipcm); 2525 res = snd_emu10k1_ipcm_peek(emu, ipcm);
2541 if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) { 2526 if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) {
2542 kfree(ipcm); 2527 kfree(ipcm);
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index 4bfc31d1b281..c1a5aa15af8f 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -490,7 +490,7 @@ void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait)
490 if (newtime != curtime) 490 if (newtime != curtime)
491 break; 491 break;
492 } 492 }
493 if (count >= 16384) 493 if (count > 16384)
494 break; 494 break;
495 curtime = newtime; 495 curtime = newtime;
496 } 496 }
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index dd63b132fb8e..fbd2ac09aa34 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1608,8 +1608,8 @@ static int __devinit snd_es1938_create(struct snd_card *card,
1608 if ((err = pci_enable_device(pci)) < 0) 1608 if ((err = pci_enable_device(pci)) < 0)
1609 return err; 1609 return err;
1610 /* check, if we can restrict PCI DMA transfers to 24 bits */ 1610 /* check, if we can restrict PCI DMA transfers to 24 bits */
1611 if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || 1611 if (pci_set_dma_mask(pci, DMA_BIT_MASK(24)) < 0 ||
1612 pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { 1612 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(24)) < 0) {
1613 snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); 1613 snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n");
1614 pci_disable_device(pci); 1614 pci_disable_device(pci);
1615 return -ENXIO; 1615 return -ENXIO;
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index dc97e8116141..a11f453a6b6d 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2539,8 +2539,8 @@ static int __devinit snd_es1968_create(struct snd_card *card,
2539 if ((err = pci_enable_device(pci)) < 0) 2539 if ((err = pci_enable_device(pci)) < 0)
2540 return err; 2540 return err;
2541 /* check, if we can restrict PCI DMA transfers to 28 bits */ 2541 /* check, if we can restrict PCI DMA transfers to 28 bits */
2542 if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || 2542 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
2543 pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { 2543 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
2544 snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); 2544 snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n");
2545 pci_disable_device(pci); 2545 pci_disable_device(pci);
2546 return -ENXIO; 2546 return -ENXIO;
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index a4e5e5952115..8820faf6c9d8 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -642,19 +642,21 @@ static int get_codec_name(struct hda_codec *codec)
642 */ 642 */
643static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec) 643static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec)
644{ 644{
645 int i, total_nodes; 645 int i, total_nodes, function_id;
646 hda_nid_t nid; 646 hda_nid_t nid;
647 647
648 total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid); 648 total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid);
649 for (i = 0; i < total_nodes; i++, nid++) { 649 for (i = 0; i < total_nodes; i++, nid++) {
650 codec->function_id = snd_hda_param_read(codec, nid, 650 function_id = snd_hda_param_read(codec, nid,
651 AC_PAR_FUNCTION_TYPE) & 0xff; 651 AC_PAR_FUNCTION_TYPE) & 0xff;
652 switch (codec->function_id) { 652 switch (function_id) {
653 case AC_GRP_AUDIO_FUNCTION: 653 case AC_GRP_AUDIO_FUNCTION:
654 codec->afg = nid; 654 codec->afg = nid;
655 codec->function_id = function_id;
655 break; 656 break;
656 case AC_GRP_MODEM_FUNCTION: 657 case AC_GRP_MODEM_FUNCTION:
657 codec->mfg = nid; 658 codec->mfg = nid;
659 codec->function_id = function_id;
658 break; 660 break;
659 default: 661 default:
660 break; 662 break;
@@ -2250,7 +2252,11 @@ int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
2250 err = bus->ops.command(bus, res); 2252 err = bus->ops.command(bus, res);
2251 if (!err) { 2253 if (!err) {
2252 struct hda_cache_head *c; 2254 struct hda_cache_head *c;
2253 u32 key = build_cmd_cache_key(nid, verb); 2255 u32 key;
2256 /* parm may contain the verb stuff for get/set amp */
2257 verb = verb | (parm >> 8);
2258 parm &= 0xff;
2259 key = build_cmd_cache_key(nid, verb);
2254 c = get_alloc_hash(&codec->cmd_cache, key); 2260 c = get_alloc_hash(&codec->cmd_cache, key);
2255 if (c) 2261 if (c)
2256 c->val = parm; 2262 c->val = parm;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 30829ee920c3..21e99cfa8c49 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -312,6 +312,8 @@ struct azx_dev {
312 unsigned int period_bytes; /* size of the period in bytes */ 312 unsigned int period_bytes; /* size of the period in bytes */
313 unsigned int frags; /* number for period in the play buffer */ 313 unsigned int frags; /* number for period in the play buffer */
314 unsigned int fifo_size; /* FIFO size */ 314 unsigned int fifo_size; /* FIFO size */
315 unsigned long start_jiffies; /* start + minimum jiffies */
316 unsigned long min_jiffies; /* minimum jiffies before position is valid */
315 317
316 void __iomem *sd_addr; /* stream descriptor pointer */ 318 void __iomem *sd_addr; /* stream descriptor pointer */
317 319
@@ -330,7 +332,7 @@ struct azx_dev {
330 unsigned int opened :1; 332 unsigned int opened :1;
331 unsigned int running :1; 333 unsigned int running :1;
332 unsigned int irq_pending :1; 334 unsigned int irq_pending :1;
333 unsigned int irq_ignore :1; 335 unsigned int start_flag: 1; /* stream full start flag */
334 /* 336 /*
335 * For VIA: 337 * For VIA:
336 * A flag to ensure DMA position is 0 338 * A flag to ensure DMA position is 0
@@ -975,7 +977,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
975 struct azx *chip = dev_id; 977 struct azx *chip = dev_id;
976 struct azx_dev *azx_dev; 978 struct azx_dev *azx_dev;
977 u32 status; 979 u32 status;
978 int i; 980 int i, ok;
979 981
980 spin_lock(&chip->reg_lock); 982 spin_lock(&chip->reg_lock);
981 983
@@ -991,18 +993,14 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
991 azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); 993 azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK);
992 if (!azx_dev->substream || !azx_dev->running) 994 if (!azx_dev->substream || !azx_dev->running)
993 continue; 995 continue;
994 /* ignore the first dummy IRQ (due to pos_adj) */
995 if (azx_dev->irq_ignore) {
996 azx_dev->irq_ignore = 0;
997 continue;
998 }
999 /* check whether this IRQ is really acceptable */ 996 /* check whether this IRQ is really acceptable */
1000 if (azx_position_ok(chip, azx_dev)) { 997 ok = azx_position_ok(chip, azx_dev);
998 if (ok == 1) {
1001 azx_dev->irq_pending = 0; 999 azx_dev->irq_pending = 0;
1002 spin_unlock(&chip->reg_lock); 1000 spin_unlock(&chip->reg_lock);
1003 snd_pcm_period_elapsed(azx_dev->substream); 1001 snd_pcm_period_elapsed(azx_dev->substream);
1004 spin_lock(&chip->reg_lock); 1002 spin_lock(&chip->reg_lock);
1005 } else if (chip->bus && chip->bus->workq) { 1003 } else if (ok == 0 && chip->bus && chip->bus->workq) {
1006 /* bogus IRQ, process it later */ 1004 /* bogus IRQ, process it later */
1007 azx_dev->irq_pending = 1; 1005 azx_dev->irq_pending = 1;
1008 queue_work(chip->bus->workq, 1006 queue_work(chip->bus->workq,
@@ -1088,7 +1086,6 @@ static int azx_setup_periods(struct azx *chip,
1088 bdl = (u32 *)azx_dev->bdl.area; 1086 bdl = (u32 *)azx_dev->bdl.area;
1089 ofs = 0; 1087 ofs = 0;
1090 azx_dev->frags = 0; 1088 azx_dev->frags = 0;
1091 azx_dev->irq_ignore = 0;
1092 pos_adj = bdl_pos_adj[chip->dev_index]; 1089 pos_adj = bdl_pos_adj[chip->dev_index];
1093 if (pos_adj > 0) { 1090 if (pos_adj > 0) {
1094 struct snd_pcm_runtime *runtime = substream->runtime; 1091 struct snd_pcm_runtime *runtime = substream->runtime;
@@ -1109,7 +1106,6 @@ static int azx_setup_periods(struct azx *chip,
1109 &bdl, ofs, pos_adj, 1); 1106 &bdl, ofs, pos_adj, 1);
1110 if (ofs < 0) 1107 if (ofs < 0)
1111 goto error; 1108 goto error;
1112 azx_dev->irq_ignore = 1;
1113 } 1109 }
1114 } else 1110 } else
1115 pos_adj = 0; 1111 pos_adj = 0;
@@ -1155,6 +1151,9 @@ static void azx_stream_reset(struct azx *chip, struct azx_dev *azx_dev)
1155 while (((val = azx_sd_readb(azx_dev, SD_CTL)) & SD_CTL_STREAM_RESET) && 1151 while (((val = azx_sd_readb(azx_dev, SD_CTL)) & SD_CTL_STREAM_RESET) &&
1156 --timeout) 1152 --timeout)
1157 ; 1153 ;
1154
1155 /* reset first position - may not be synced with hw at this time */
1156 *azx_dev->posbuf = 0;
1158} 1157}
1159 1158
1160/* 1159/*
@@ -1409,7 +1408,6 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
1409 snd_pcm_set_sync(substream); 1408 snd_pcm_set_sync(substream);
1410 mutex_unlock(&chip->open_mutex); 1409 mutex_unlock(&chip->open_mutex);
1411 1410
1412 azx_stream_reset(chip, azx_dev);
1413 return 0; 1411 return 0;
1414} 1412}
1415 1413
@@ -1474,6 +1472,7 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
1474 unsigned int bufsize, period_bytes, format_val; 1472 unsigned int bufsize, period_bytes, format_val;
1475 int err; 1473 int err;
1476 1474
1475 azx_stream_reset(chip, azx_dev);
1477 format_val = snd_hda_calc_stream_format(runtime->rate, 1476 format_val = snd_hda_calc_stream_format(runtime->rate,
1478 runtime->channels, 1477 runtime->channels,
1479 runtime->format, 1478 runtime->format,
@@ -1502,6 +1501,8 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
1502 return err; 1501 return err;
1503 } 1502 }
1504 1503
1504 azx_dev->min_jiffies = (runtime->period_size * HZ) /
1505 (runtime->rate * 2);
1505 azx_setup_controller(chip, azx_dev); 1506 azx_setup_controller(chip, azx_dev);
1506 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 1507 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
1507 azx_dev->fifo_size = azx_sd_readw(azx_dev, SD_FIFOSIZE) + 1; 1508 azx_dev->fifo_size = azx_sd_readw(azx_dev, SD_FIFOSIZE) + 1;
@@ -1518,13 +1519,14 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1518 struct azx *chip = apcm->chip; 1519 struct azx *chip = apcm->chip;
1519 struct azx_dev *azx_dev; 1520 struct azx_dev *azx_dev;
1520 struct snd_pcm_substream *s; 1521 struct snd_pcm_substream *s;
1521 int start, nsync = 0, sbits = 0; 1522 int rstart = 0, start, nsync = 0, sbits = 0;
1522 int nwait, timeout; 1523 int nwait, timeout;
1523 1524
1524 switch (cmd) { 1525 switch (cmd) {
1526 case SNDRV_PCM_TRIGGER_START:
1527 rstart = 1;
1525 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 1528 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
1526 case SNDRV_PCM_TRIGGER_RESUME: 1529 case SNDRV_PCM_TRIGGER_RESUME:
1527 case SNDRV_PCM_TRIGGER_START:
1528 start = 1; 1530 start = 1;
1529 break; 1531 break;
1530 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 1532 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
@@ -1554,6 +1556,10 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1554 if (s->pcm->card != substream->pcm->card) 1556 if (s->pcm->card != substream->pcm->card)
1555 continue; 1557 continue;
1556 azx_dev = get_azx_dev(s); 1558 azx_dev = get_azx_dev(s);
1559 if (rstart) {
1560 azx_dev->start_flag = 1;
1561 azx_dev->start_jiffies = jiffies + azx_dev->min_jiffies;
1562 }
1557 if (start) 1563 if (start)
1558 azx_stream_start(chip, azx_dev); 1564 azx_stream_start(chip, azx_dev);
1559 else 1565 else
@@ -1703,6 +1709,11 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
1703{ 1709{
1704 unsigned int pos; 1710 unsigned int pos;
1705 1711
1712 if (azx_dev->start_flag &&
1713 time_before_eq(jiffies, azx_dev->start_jiffies))
1714 return -1; /* bogus (too early) interrupt */
1715 azx_dev->start_flag = 0;
1716
1706 pos = azx_get_position(chip, azx_dev); 1717 pos = azx_get_position(chip, azx_dev);
1707 if (chip->position_fix == POS_FIX_AUTO) { 1718 if (chip->position_fix == POS_FIX_AUTO) {
1708 if (!pos) { 1719 if (!pos) {
@@ -2260,11 +2271,11 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2260 gcap &= ~0x01; 2271 gcap &= ~0x01;
2261 2272
2262 /* allow 64bit DMA address if supported by H/W */ 2273 /* allow 64bit DMA address if supported by H/W */
2263 if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_64BIT_MASK)) 2274 if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
2264 pci_set_consistent_dma_mask(pci, DMA_64BIT_MASK); 2275 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
2265 else { 2276 else {
2266 pci_set_dma_mask(pci, DMA_32BIT_MASK); 2277 pci_set_dma_mask(pci, DMA_BIT_MASK(32));
2267 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK); 2278 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
2268 } 2279 }
2269 2280
2270 /* read number of streams from GCAP register instead of using 2281 /* read number of streams from GCAP register instead of using
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 5bb48ee8b6c6..9bcd8ab5a27f 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3256,7 +3256,7 @@ static const char *ad1884_slave_vols[] = {
3256 "Mic Playback Volume", 3256 "Mic Playback Volume",
3257 "CD Playback Volume", 3257 "CD Playback Volume",
3258 "Internal Mic Playback Volume", 3258 "Internal Mic Playback Volume",
3259 "Docking Mic Playback Volume" 3259 "Docking Mic Playback Volume",
3260 /* "Beep Playback Volume", */ 3260 /* "Beep Playback Volume", */
3261 "IEC958 Playback Volume", 3261 "IEC958 Playback Volume",
3262 NULL 3262 NULL
@@ -3977,6 +3977,14 @@ static int patch_ad1884a(struct hda_codec *codec)
3977 spec->input_mux = &ad1884a_laptop_capture_source; 3977 spec->input_mux = &ad1884a_laptop_capture_source;
3978 codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; 3978 codec->patch_ops.unsol_event = ad1884a_hp_unsol_event;
3979 codec->patch_ops.init = ad1884a_hp_init; 3979 codec->patch_ops.init = ad1884a_hp_init;
3980 /* set the upper-limit for mixer amp to 0dB for avoiding the
3981 * possible damage by overloading
3982 */
3983 snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT,
3984 (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
3985 (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
3986 (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3987 (1 << AC_AMPCAP_MUTE_SHIFT));
3980 break; 3988 break;
3981 case AD1884A_MOBILE: 3989 case AD1884A_MOBILE:
3982 spec->mixers[0] = ad1884a_mobile_mixers; 3990 spec->mixers[0] = ad1884a_mobile_mixers;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 1f2ad76ca94b..56ce19e68cb5 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -350,12 +350,20 @@ static int conexant_mux_enum_put(struct snd_kcontrol *kcontrol,
350} 350}
351 351
352#ifdef CONFIG_SND_JACK 352#ifdef CONFIG_SND_JACK
353static void conexant_free_jack_priv(struct snd_jack *jack)
354{
355 struct conexant_jack *jacks = jack->private_data;
356 jacks->nid = 0;
357 jacks->jack = NULL;
358}
359
353static int conexant_add_jack(struct hda_codec *codec, 360static int conexant_add_jack(struct hda_codec *codec,
354 hda_nid_t nid, int type) 361 hda_nid_t nid, int type)
355{ 362{
356 struct conexant_spec *spec; 363 struct conexant_spec *spec;
357 struct conexant_jack *jack; 364 struct conexant_jack *jack;
358 const char *name; 365 const char *name;
366 int err;
359 367
360 spec = codec->spec; 368 spec = codec->spec;
361 snd_array_init(&spec->jacks, sizeof(*jack), 32); 369 snd_array_init(&spec->jacks, sizeof(*jack), 32);
@@ -368,7 +376,12 @@ static int conexant_add_jack(struct hda_codec *codec,
368 jack->nid = nid; 376 jack->nid = nid;
369 jack->type = type; 377 jack->type = type;
370 378
371 return snd_jack_new(codec->bus->card, name, type, &jack->jack); 379 err = snd_jack_new(codec->bus->card, name, type, &jack->jack);
380 if (err < 0)
381 return err;
382 jack->jack->private_data = jack;
383 jack->jack->private_free = conexant_free_jack_priv;
384 return 0;
372} 385}
373 386
374static void conexant_report_jack(struct hda_codec *codec, hda_nid_t nid) 387static void conexant_report_jack(struct hda_codec *codec, hda_nid_t nid)
@@ -455,8 +468,10 @@ static void conexant_free(struct hda_codec *codec)
455 if (spec->jacks.list) { 468 if (spec->jacks.list) {
456 struct conexant_jack *jacks = spec->jacks.list; 469 struct conexant_jack *jacks = spec->jacks.list;
457 int i; 470 int i;
458 for (i = 0; i < spec->jacks.used; i++) 471 for (i = 0; i < spec->jacks.used; i++, jacks++) {
459 snd_device_free(codec->bus->card, &jacks[i].jack); 472 if (jacks->jack)
473 snd_device_free(codec->bus->card, jacks->jack);
474 }
460 snd_array_free(&spec->jacks); 475 snd_array_free(&spec->jacks);
461 } 476 }
462#endif 477#endif
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 82097790f6f3..6ed787eedd06 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -8742,10 +8742,9 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8742 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC883_LAPTOP_EAPD), 8742 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC883_LAPTOP_EAPD),
8743 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch), 8743 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
8744 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), 8744 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
8745 SND_PCI_QUIRK(0x1734, 0x1107, "FSC AMILO Xi2550", 8745 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1100, "FSC AMILO Xi/Pi25xx",
8746 ALC883_FUJITSU_PI2515), 8746 ALC883_FUJITSU_PI2515),
8747 SND_PCI_QUIRK(0x1734, 0x1108, "Fujitsu AMILO Pi2515", ALC883_FUJITSU_PI2515), 8747 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1130, "Fujitsu AMILO Xa35xx",
8748 SND_PCI_QUIRK(0x1734, 0x113d, "Fujitsu AMILO Xa3530",
8749 ALC888_FUJITSU_XA3530), 8748 ALC888_FUJITSU_XA3530),
8750 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), 8749 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch),
8751 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763), 8750 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763),
@@ -8764,6 +8763,10 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8764 {} 8763 {}
8765}; 8764};
8766 8765
8766static hda_nid_t alc883_slave_dig_outs[] = {
8767 ALC1200_DIGOUT_NID, 0,
8768};
8769
8767static hda_nid_t alc1200_slave_dig_outs[] = { 8770static hda_nid_t alc1200_slave_dig_outs[] = {
8768 ALC883_DIGOUT_NID, 0, 8771 ALC883_DIGOUT_NID, 0,
8769}; 8772};
@@ -8809,6 +8812,7 @@ static struct alc_config_preset alc883_presets[] = {
8809 .dac_nids = alc883_dac_nids, 8812 .dac_nids = alc883_dac_nids,
8810 .dig_out_nid = ALC883_DIGOUT_NID, 8813 .dig_out_nid = ALC883_DIGOUT_NID,
8811 .dig_in_nid = ALC883_DIGIN_NID, 8814 .dig_in_nid = ALC883_DIGIN_NID,
8815 .slave_dig_outs = alc883_slave_dig_outs,
8812 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_intel_modes), 8816 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_intel_modes),
8813 .channel_mode = alc883_3ST_6ch_intel_modes, 8817 .channel_mode = alc883_3ST_6ch_intel_modes,
8814 .need_dac_fix = 1, 8818 .need_dac_fix = 1,
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index b5e108aa8f63..917bc5d3ac2c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3076,6 +3076,11 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs,
3076 unsigned int wid_caps; 3076 unsigned int wid_caps;
3077 3077
3078 for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) { 3078 for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) {
3079 if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) {
3080 wid_caps = get_wcaps(codec, pins[i]);
3081 if (wid_caps & AC_WCAP_UNSOL_CAP)
3082 spec->hp_detect = 1;
3083 }
3079 nid = dac_nids[i]; 3084 nid = dac_nids[i];
3080 if (!nid) 3085 if (!nid)
3081 continue; 3086 continue;
@@ -3119,11 +3124,6 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs,
3119 err = create_controls_idx(codec, name, idx, nid, 3); 3124 err = create_controls_idx(codec, name, idx, nid, 3);
3120 if (err < 0) 3125 if (err < 0)
3121 return err; 3126 return err;
3122 if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) {
3123 wid_caps = get_wcaps(codec, pins[i]);
3124 if (wid_caps & AC_WCAP_UNSOL_CAP)
3125 spec->hp_detect = 1;
3126 }
3127 } 3127 }
3128 } 3128 }
3129 return 0; 3129 return 0;
@@ -3851,6 +3851,15 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
3851 AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */ 3851 AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */
3852} 3852}
3853 3853
3854#ifdef CONFIG_SND_JACK
3855static void stac92xx_free_jack_priv(struct snd_jack *jack)
3856{
3857 struct sigmatel_jack *jacks = jack->private_data;
3858 jacks->nid = 0;
3859 jacks->jack = NULL;
3860}
3861#endif
3862
3854static int stac92xx_add_jack(struct hda_codec *codec, 3863static int stac92xx_add_jack(struct hda_codec *codec,
3855 hda_nid_t nid, int type) 3864 hda_nid_t nid, int type)
3856{ 3865{
@@ -3860,6 +3869,7 @@ static int stac92xx_add_jack(struct hda_codec *codec,
3860 int def_conf = snd_hda_codec_get_pincfg(codec, nid); 3869 int def_conf = snd_hda_codec_get_pincfg(codec, nid);
3861 int connectivity = get_defcfg_connect(def_conf); 3870 int connectivity = get_defcfg_connect(def_conf);
3862 char name[32]; 3871 char name[32];
3872 int err;
3863 3873
3864 if (connectivity && connectivity != AC_JACK_PORT_FIXED) 3874 if (connectivity && connectivity != AC_JACK_PORT_FIXED)
3865 return 0; 3875 return 0;
@@ -3876,10 +3886,15 @@ static int stac92xx_add_jack(struct hda_codec *codec,
3876 snd_hda_get_jack_connectivity(def_conf), 3886 snd_hda_get_jack_connectivity(def_conf),
3877 snd_hda_get_jack_location(def_conf)); 3887 snd_hda_get_jack_location(def_conf));
3878 3888
3879 return snd_jack_new(codec->bus->card, name, type, &jack->jack); 3889 err = snd_jack_new(codec->bus->card, name, type, &jack->jack);
3880#else 3890 if (err < 0) {
3881 return 0; 3891 jack->nid = 0;
3892 return err;
3893 }
3894 jack->jack->private_data = jack;
3895 jack->jack->private_free = stac92xx_free_jack_priv;
3882#endif 3896#endif
3897 return 0;
3883} 3898}
3884 3899
3885static int stac_add_event(struct sigmatel_spec *spec, hda_nid_t nid, 3900static int stac_add_event(struct sigmatel_spec *spec, hda_nid_t nid,
@@ -4138,8 +4153,10 @@ static void stac92xx_free_jacks(struct hda_codec *codec)
4138 if (!codec->bus->shutdown && spec->jacks.list) { 4153 if (!codec->bus->shutdown && spec->jacks.list) {
4139 struct sigmatel_jack *jacks = spec->jacks.list; 4154 struct sigmatel_jack *jacks = spec->jacks.list;
4140 int i; 4155 int i;
4141 for (i = 0; i < spec->jacks.used; i++) 4156 for (i = 0; i < spec->jacks.used; i++, jacks++) {
4142 snd_device_free(codec->bus->card, &jacks[i].jack); 4157 if (jacks->jack)
4158 snd_device_free(codec->bus->card, jacks->jack);
4159 }
4143 } 4160 }
4144 snd_array_free(&spec->jacks); 4161 snd_array_free(&spec->jacks);
4145#endif 4162#endif
@@ -4413,6 +4430,24 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4413 if (spec->num_pwrs > 0) 4430 if (spec->num_pwrs > 0)
4414 stac92xx_pin_sense(codec, event->nid); 4431 stac92xx_pin_sense(codec, event->nid);
4415 stac92xx_report_jack(codec, event->nid); 4432 stac92xx_report_jack(codec, event->nid);
4433
4434 switch (codec->subsystem_id) {
4435 case 0x103c308f:
4436 if (event->nid == 0xb) {
4437 int pin = AC_PINCTL_IN_EN;
4438
4439 if (get_pin_presence(codec, 0xa)
4440 && get_pin_presence(codec, 0xb))
4441 pin |= AC_PINCTL_VREF_80;
4442 if (!get_pin_presence(codec, 0xb))
4443 pin |= AC_PINCTL_VREF_80;
4444
4445 /* toggle VREF state based on mic + hp pin
4446 * status
4447 */
4448 stac92xx_auto_set_pinctl(codec, 0x0a, pin);
4449 }
4450 }
4416 break; 4451 break;
4417 case STAC_VREF_EVENT: 4452 case STAC_VREF_EVENT:
4418 data = snd_hda_codec_read(codec, codec->afg, 0, 4453 data = snd_hda_codec_read(codec, codec->afg, 0,
@@ -4895,6 +4930,7 @@ again:
4895 switch (codec->vendor_id) { 4930 switch (codec->vendor_id) {
4896 case 0x111d7604: 4931 case 0x111d7604:
4897 case 0x111d7605: 4932 case 0x111d7605:
4933 case 0x111d76d5:
4898 if (spec->board_config == STAC_92HD83XXX_PWR_REF) 4934 if (spec->board_config == STAC_92HD83XXX_PWR_REF)
4899 break; 4935 break;
4900 spec->num_pwrs = 0; 4936 spec->num_pwrs = 0;
@@ -5707,6 +5743,7 @@ static struct hda_codec_preset snd_hda_preset_sigmatel[] = {
5707 { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx}, 5743 { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx},
5708 { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx}, 5744 { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx},
5709 { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx}, 5745 { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx},
5746 { .id = 0x111d76d5, .name = "92HD81B1C5", .patch = patch_stac92hd83xxx},
5710 { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx}, 5747 { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx},
5711 { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx }, 5748 { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx },
5712 { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx }, 5749 { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx },
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 3dd63f1cda53..0d0cdbdb4486 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2533,8 +2533,8 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
2533 if (err < 0) 2533 if (err < 0)
2534 return err; 2534 return err;
2535 /* check, if we can restrict PCI DMA transfers to 28 bits */ 2535 /* check, if we can restrict PCI DMA transfers to 28 bits */
2536 if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || 2536 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
2537 pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { 2537 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
2538 snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); 2538 snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n");
2539 pci_disable_device(pci); 2539 pci_disable_device(pci);
2540 return -ENXIO; 2540 return -ENXIO;
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 57648810eaf1..8042d5398892 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -355,6 +355,9 @@ struct ichdev {
355 unsigned int fragsize1; 355 unsigned int fragsize1;
356 unsigned int position; 356 unsigned int position;
357 unsigned int pos_shift; 357 unsigned int pos_shift;
358 unsigned int last_pos;
359 unsigned long last_pos_jiffies;
360 unsigned int jiffy_to_bytes;
358 int frags; 361 int frags;
359 int lvi; 362 int lvi;
360 int lvi_frag; 363 int lvi_frag;
@@ -838,7 +841,10 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
838 ichdev->suspended = 0; 841 ichdev->suspended = 0;
839 /* fallthru */ 842 /* fallthru */
840 case SNDRV_PCM_TRIGGER_START: 843 case SNDRV_PCM_TRIGGER_START:
844 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
841 val = ICH_IOCE | ICH_STARTBM; 845 val = ICH_IOCE | ICH_STARTBM;
846 ichdev->last_pos = ichdev->position;
847 ichdev->last_pos_jiffies = jiffies;
842 break; 848 break;
843 case SNDRV_PCM_TRIGGER_SUSPEND: 849 case SNDRV_PCM_TRIGGER_SUSPEND:
844 ichdev->suspended = 1; 850 ichdev->suspended = 1;
@@ -849,9 +855,6 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
849 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 855 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
850 val = ICH_IOCE; 856 val = ICH_IOCE;
851 break; 857 break;
852 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
853 val = ICH_IOCE | ICH_STARTBM;
854 break;
855 default: 858 default:
856 return -EINVAL; 859 return -EINVAL;
857 } 860 }
@@ -1045,6 +1048,7 @@ static int snd_intel8x0_pcm_prepare(struct snd_pcm_substream *substream)
1045 ichdev->pos_shift = (runtime->sample_bits > 16) ? 2 : 1; 1048 ichdev->pos_shift = (runtime->sample_bits > 16) ? 2 : 1;
1046 } 1049 }
1047 snd_intel8x0_setup_periods(chip, ichdev); 1050 snd_intel8x0_setup_periods(chip, ichdev);
1051 ichdev->jiffy_to_bytes = (runtime->rate * 4 * ichdev->pos_shift) / HZ;
1048 return 0; 1052 return 0;
1049} 1053}
1050 1054
@@ -1053,7 +1057,7 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *subs
1053 struct intel8x0 *chip = snd_pcm_substream_chip(substream); 1057 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1054 struct ichdev *ichdev = get_ichdev(substream); 1058 struct ichdev *ichdev = get_ichdev(substream);
1055 size_t ptr1, ptr; 1059 size_t ptr1, ptr;
1056 int civ, timeout = 100; 1060 int civ, timeout = 10;
1057 unsigned int position; 1061 unsigned int position;
1058 1062
1059 spin_lock(&chip->reg_lock); 1063 spin_lock(&chip->reg_lock);
@@ -1069,9 +1073,19 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *subs
1069 ptr1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb)) 1073 ptr1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb))
1070 break; 1074 break;
1071 } while (timeout--); 1075 } while (timeout--);
1072 ptr1 <<= ichdev->pos_shift; 1076 if (ptr1 != 0) {
1073 ptr = ichdev->fragsize1 - ptr1; 1077 ptr1 <<= ichdev->pos_shift;
1074 ptr += position; 1078 ptr = ichdev->fragsize1 - ptr1;
1079 ptr += position;
1080 ichdev->last_pos = ptr;
1081 ichdev->last_pos_jiffies = jiffies;
1082 } else {
1083 ptr1 = jiffies - ichdev->last_pos_jiffies;
1084 if (ptr1)
1085 ptr1 -= 1;
1086 ptr = ichdev->last_pos + ptr1 * ichdev->jiffy_to_bytes;
1087 ptr %= ichdev->size;
1088 }
1075 spin_unlock(&chip->reg_lock); 1089 spin_unlock(&chip->reg_lock);
1076 if (ptr >= ichdev->size) 1090 if (ptr >= ichdev->size)
1077 return 0; 1091 return 0;
@@ -1840,6 +1854,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1840 }, 1854 },
1841 { 1855 {
1842 .subvendor = 0x1028, 1856 .subvendor = 0x1028,
1857 .subdevice = 0x016a,
1858 .name = "Dell Inspiron 8600", /* STAC9750/51 */
1859 .type = AC97_TUNE_HP_ONLY
1860 },
1861 {
1862 .subvendor = 0x1028,
1843 .subdevice = 0x0186, 1863 .subdevice = 0x0186,
1844 .name = "Dell Latitude D810", /* cf. Malone #41015 */ 1864 .name = "Dell Latitude D810", /* cf. Malone #41015 */
1845 .type = AC97_TUNE_HP_MUTE_LED 1865 .type = AC97_TUNE_HP_MUTE_LED
@@ -1882,12 +1902,6 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1882 }, 1902 },
1883 { 1903 {
1884 .subvendor = 0x103c, 1904 .subvendor = 0x103c,
1885 .subdevice = 0x0934,
1886 .name = "HP nx8220",
1887 .type = AC97_TUNE_MUTE_LED
1888 },
1889 {
1890 .subvendor = 0x103c,
1891 .subdevice = 0x129d, 1905 .subdevice = 0x129d,
1892 .name = "HP xw8000", 1906 .name = "HP xw8000",
1893 .type = AC97_TUNE_HP_ONLY 1907 .type = AC97_TUNE_HP_ONLY
@@ -2661,12 +2675,14 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
2661 struct snd_pcm_substream *subs; 2675 struct snd_pcm_substream *subs;
2662 struct ichdev *ichdev; 2676 struct ichdev *ichdev;
2663 unsigned long port; 2677 unsigned long port;
2664 unsigned long pos, t; 2678 unsigned long pos, pos1, t;
2665 struct timeval start_time, stop_time; 2679 int civ, timeout = 1000, attempt = 1;
2680 struct timespec start_time, stop_time;
2666 2681
2667 if (chip->ac97_bus->clock != 48000) 2682 if (chip->ac97_bus->clock != 48000)
2668 return; /* specified in module option */ 2683 return; /* specified in module option */
2669 2684
2685 __again:
2670 subs = chip->pcm[0]->streams[0].substream; 2686 subs = chip->pcm[0]->streams[0].substream;
2671 if (! subs || subs->dma_buffer.bytes < INTEL8X0_TESTBUF_SIZE) { 2687 if (! subs || subs->dma_buffer.bytes < INTEL8X0_TESTBUF_SIZE) {
2672 snd_printk(KERN_WARNING "no playback buffer allocated - aborting measure ac97 clock\n"); 2688 snd_printk(KERN_WARNING "no playback buffer allocated - aborting measure ac97 clock\n");
@@ -2674,7 +2690,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
2674 } 2690 }
2675 ichdev = &chip->ichd[ICHD_PCMOUT]; 2691 ichdev = &chip->ichd[ICHD_PCMOUT];
2676 ichdev->physbuf = subs->dma_buffer.addr; 2692 ichdev->physbuf = subs->dma_buffer.addr;
2677 ichdev->size = chip->ichd[ICHD_PCMOUT].fragsize = INTEL8X0_TESTBUF_SIZE; 2693 ichdev->size = ichdev->fragsize = INTEL8X0_TESTBUF_SIZE;
2678 ichdev->substream = NULL; /* don't process interrupts */ 2694 ichdev->substream = NULL; /* don't process interrupts */
2679 2695
2680 /* set rate */ 2696 /* set rate */
@@ -2693,16 +2709,31 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
2693 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_IOCE); 2709 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_IOCE);
2694 iputdword(chip, ICHREG(ALI_DMACR), 1 << ichdev->ali_slot); 2710 iputdword(chip, ICHREG(ALI_DMACR), 1 << ichdev->ali_slot);
2695 } 2711 }
2696 do_gettimeofday(&start_time); 2712 do_posix_clock_monotonic_gettime(&start_time);
2697 spin_unlock_irq(&chip->reg_lock); 2713 spin_unlock_irq(&chip->reg_lock);
2698 msleep(50); 2714 msleep(50);
2699 spin_lock_irq(&chip->reg_lock); 2715 spin_lock_irq(&chip->reg_lock);
2700 /* check the position */ 2716 /* check the position */
2701 pos = ichdev->fragsize1; 2717 do {
2702 pos -= igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << ichdev->pos_shift; 2718 civ = igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV);
2703 pos += ichdev->position; 2719 pos1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb);
2720 if (pos1 == 0) {
2721 udelay(10);
2722 continue;
2723 }
2724 if (civ == igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV) &&
2725 pos1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb))
2726 break;
2727 } while (timeout--);
2728 if (pos1 == 0) { /* oops, this value is not reliable */
2729 pos = 0;
2730 } else {
2731 pos = ichdev->fragsize1;
2732 pos -= pos1 << ichdev->pos_shift;
2733 pos += ichdev->position;
2734 }
2704 chip->in_measurement = 0; 2735 chip->in_measurement = 0;
2705 do_gettimeofday(&stop_time); 2736 do_posix_clock_monotonic_gettime(&stop_time);
2706 /* stop */ 2737 /* stop */
2707 if (chip->device_type == DEVICE_ALI) { 2738 if (chip->device_type == DEVICE_ALI) {
2708 iputdword(chip, ICHREG(ALI_DMACR), 1 << (ichdev->ali_slot + 16)); 2739 iputdword(chip, ICHREG(ALI_DMACR), 1 << (ichdev->ali_slot + 16));
@@ -2717,19 +2748,37 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
2717 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS); 2748 iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS);
2718 spin_unlock_irq(&chip->reg_lock); 2749 spin_unlock_irq(&chip->reg_lock);
2719 2750
2751 if (pos == 0) {
2752 snd_printk(KERN_ERR "intel8x0: measure - unreliable DMA position..\n");
2753 __retry:
2754 if (attempt < 2) {
2755 attempt++;
2756 goto __again;
2757 }
2758 return;
2759 }
2760
2761 pos /= 4;
2720 t = stop_time.tv_sec - start_time.tv_sec; 2762 t = stop_time.tv_sec - start_time.tv_sec;
2721 t *= 1000000; 2763 t *= 1000000;
2722 t += stop_time.tv_usec - start_time.tv_usec; 2764 t += (stop_time.tv_nsec - start_time.tv_nsec) / 1000;
2723 printk(KERN_INFO "%s: measured %lu usecs\n", __func__, t); 2765 printk(KERN_INFO "%s: measured %lu usecs (%lu samples)\n", __func__, t, pos);
2724 if (t == 0) { 2766 if (t == 0) {
2725 snd_printk(KERN_ERR "?? calculation error..\n"); 2767 snd_printk(KERN_ERR "intel8x0: ?? calculation error..\n");
2726 return; 2768 goto __retry;
2727 } 2769 }
2728 pos = (pos / 4) * 1000; 2770 pos *= 1000;
2729 pos = (pos / t) * 1000 + ((pos % t) * 1000) / t; 2771 pos = (pos / t) * 1000 + ((pos % t) * 1000) / t;
2730 if (pos < 40000 || pos >= 60000) 2772 if (pos < 40000 || pos >= 60000) {
2731 /* abnormal value. hw problem? */ 2773 /* abnormal value. hw problem? */
2732 printk(KERN_INFO "intel8x0: measured clock %ld rejected\n", pos); 2774 printk(KERN_INFO "intel8x0: measured clock %ld rejected\n", pos);
2775 goto __retry;
2776 } else if (pos > 40500 && pos < 41500)
2777 /* first exception - 41000Hz reference clock */
2778 chip->ac97_bus->clock = 41000;
2779 else if (pos > 43600 && pos < 44600)
2780 /* second exception - 44100HZ reference clock */
2781 chip->ac97_bus->clock = 44100;
2733 else if (pos < 47500 || pos > 48500) 2782 else if (pos < 47500 || pos > 48500)
2734 /* not 48000Hz, tuning the clock.. */ 2783 /* not 48000Hz, tuning the clock.. */
2735 chip->ac97_bus->clock = (chip->ac97_bus->clock * 48000) / pos; 2784 chip->ac97_bus->clock = (chip->ac97_bus->clock * 48000) / pos;
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 70141548f251..75283fbb4b3f 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2530,8 +2530,8 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
2530 return -EIO; 2530 return -EIO;
2531 2531
2532 /* check, if we can restrict PCI DMA transfers to 28 bits */ 2532 /* check, if we can restrict PCI DMA transfers to 28 bits */
2533 if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || 2533 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
2534 pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { 2534 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
2535 snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); 2535 snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n");
2536 pci_disable_device(pci); 2536 pci_disable_device(pci);
2537 return -ENXIO; 2537 return -ENXIO;
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index c1eb84a14c42..82bc5b9e7629 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -1291,7 +1291,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1291 pci_set_master(pci); 1291 pci_set_master(pci);
1292 1292
1293 /* check if we can restrict PCI DMA transfers to 32 bits */ 1293 /* check if we can restrict PCI DMA transfers to 32 bits */
1294 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) { 1294 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
1295 snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n"); 1295 snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n");
1296 pci_disable_device(pci); 1296 pci_disable_device(pci);
1297 return -ENXIO; 1297 return -ENXIO;
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 80e064a3efff..833e9c7b27c7 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -1449,7 +1449,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci,
1449 pci_set_master(pci); 1449 pci_set_master(pci);
1450 1450
1451 /* check if we can restrict PCI DMA transfers to 32 bits */ 1451 /* check if we can restrict PCI DMA transfers to 32 bits */
1452 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) { 1452 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
1453 snd_printk(KERN_ERR "architecture does not support " 1453 snd_printk(KERN_ERR "architecture does not support "
1454 "32bit PCI busmaster DMA\n"); 1454 "32bit PCI busmaster DMA\n");
1455 pci_disable_device(pci); 1455 pci_disable_device(pci);
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index baf6d8e3dabc..1a5ff0611072 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1300,7 +1300,7 @@ static int __devinit sis_chip_create(struct snd_card *card,
1300 if (rc) 1300 if (rc)
1301 goto error_out; 1301 goto error_out;
1302 1302
1303 if (pci_set_dma_mask(pci, DMA_30BIT_MASK) < 0) { 1303 if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0) {
1304 printk(KERN_ERR "sis7019: architecture does not support " 1304 printk(KERN_ERR "sis7019: architecture does not support "
1305 "30-bit PCI busmaster DMA"); 1305 "30-bit PCI busmaster DMA");
1306 goto error_out_enabled; 1306 goto error_out_enabled;
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index d989215f3556..7dc60ad4772e 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -1264,8 +1264,8 @@ static int __devinit snd_sonicvibes_create(struct snd_card *card,
1264 if ((err = pci_enable_device(pci)) < 0) 1264 if ((err = pci_enable_device(pci)) < 0)
1265 return err; 1265 return err;
1266 /* check, if we can restrict PCI DMA transfers to 24 bits */ 1266 /* check, if we can restrict PCI DMA transfers to 24 bits */
1267 if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || 1267 if (pci_set_dma_mask(pci, DMA_BIT_MASK(24)) < 0 ||
1268 pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { 1268 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(24)) < 0) {
1269 snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); 1269 snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n");
1270 pci_disable_device(pci); 1270 pci_disable_device(pci);
1271 return -ENXIO; 1271 return -ENXIO;
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index a9da9c184660..6d943f6f6b70 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3559,8 +3559,8 @@ int __devinit snd_trident_create(struct snd_card *card,
3559 if ((err = pci_enable_device(pci)) < 0) 3559 if ((err = pci_enable_device(pci)) < 0)
3560 return err; 3560 return err;
3561 /* check, if we can restrict PCI DMA transfers to 30 bits */ 3561 /* check, if we can restrict PCI DMA transfers to 30 bits */
3562 if (pci_set_dma_mask(pci, DMA_30BIT_MASK) < 0 || 3562 if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0 ||
3563 pci_set_consistent_dma_mask(pci, DMA_30BIT_MASK) < 0) { 3563 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(30)) < 0) {
3564 snd_printk(KERN_ERR "architecture does not support 30bit PCI busmaster DMA\n"); 3564 snd_printk(KERN_ERR "architecture does not support 30bit PCI busmaster DMA\n");
3565 pci_disable_device(pci); 3565 pci_disable_device(pci);
3566 return -ENXIO; 3566 return -ENXIO;
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c
index 5a929069dce9..a2b69b8cff43 100644
--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -51,7 +51,7 @@ static struct platform_device *device;
51/* 51/*
52 */ 52 */
53 53
54static int __init snd_pmac_probe(struct platform_device *devptr) 54static int __devinit snd_pmac_probe(struct platform_device *devptr)
55{ 55{
56 struct snd_card *card; 56 struct snd_card *card;
57 struct snd_pmac *chip; 57 struct snd_pmac *chip;
diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
index 8cfed1a5dcbe..cf0dfb7ca221 100644
--- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
@@ -413,7 +413,7 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
413 sport_done(sport_handle); 413 sport_done(sport_handle);
414} 414}
415 415
416static u64 bf5xx_pcm_dmamask = DMA_32BIT_MASK; 416static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
417 417
418int bf5xx_pcm_ac97_new(struct snd_card *card, struct snd_soc_dai *dai, 418int bf5xx_pcm_ac97_new(struct snd_card *card, struct snd_soc_dai *dai,
419 struct snd_pcm *pcm) 419 struct snd_pcm *pcm)
@@ -424,7 +424,7 @@ int bf5xx_pcm_ac97_new(struct snd_card *card, struct snd_soc_dai *dai,
424 if (!card->dev->dma_mask) 424 if (!card->dev->dma_mask)
425 card->dev->dma_mask = &bf5xx_pcm_dmamask; 425 card->dev->dma_mask = &bf5xx_pcm_dmamask;
426 if (!card->dev->coherent_dma_mask) 426 if (!card->dev->coherent_dma_mask)
427 card->dev->coherent_dma_mask = DMA_32BIT_MASK; 427 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
428 428
429 if (dai->playback.channels_min) { 429 if (dai->playback.channels_min) {
430 ret = bf5xx_pcm_preallocate_dma_buffer(pcm, 430 ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
index 1318c4f627b7..62fbb8459569 100644
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -245,7 +245,7 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
245 sport_done(sport_handle); 245 sport_done(sport_handle);
246} 246}
247 247
248static u64 bf5xx_pcm_dmamask = DMA_32BIT_MASK; 248static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
249 249
250int bf5xx_pcm_i2s_new(struct snd_card *card, struct snd_soc_dai *dai, 250int bf5xx_pcm_i2s_new(struct snd_card *card, struct snd_soc_dai *dai,
251 struct snd_pcm *pcm) 251 struct snd_pcm *pcm)
@@ -256,7 +256,7 @@ int bf5xx_pcm_i2s_new(struct snd_card *card, struct snd_soc_dai *dai,
256 if (!card->dev->dma_mask) 256 if (!card->dev->dma_mask)
257 card->dev->dma_mask = &bf5xx_pcm_dmamask; 257 card->dev->dma_mask = &bf5xx_pcm_dmamask;
258 if (!card->dev->coherent_dma_mask) 258 if (!card->dev->coherent_dma_mask)
259 card->dev->coherent_dma_mask = DMA_32BIT_MASK; 259 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
260 260
261 if (dai->playback.channels_min) { 261 if (dai->playback.channels_min) {
262 ret = bf5xx_pcm_preallocate_dma_buffer(pcm, 262 ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 1f63d387a2f4..dd3380202766 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -659,7 +659,8 @@ static int ak4535_remove(struct platform_device *pdev)
659 snd_soc_free_pcms(socdev); 659 snd_soc_free_pcms(socdev);
660 snd_soc_dapm_free(socdev); 660 snd_soc_dapm_free(socdev);
661#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 661#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
662 i2c_unregister_device(codec->control_data); 662 if (codec->control_data)
663 i2c_unregister_device(codec->control_data);
663 i2c_del_driver(&ak4535_i2c_driver); 664 i2c_del_driver(&ak4535_i2c_driver);
664#endif 665#endif
665 kfree(codec->private_data); 666 kfree(codec->private_data);
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 97738e2ece04..921b205de28a 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -122,6 +122,9 @@ struct twl4030_priv {
122 unsigned int bypass_state; 122 unsigned int bypass_state;
123 unsigned int codec_powered; 123 unsigned int codec_powered;
124 unsigned int codec_muted; 124 unsigned int codec_muted;
125
126 struct snd_pcm_substream *master_substream;
127 struct snd_pcm_substream *slave_substream;
125}; 128};
126 129
127/* 130/*
@@ -1217,6 +1220,52 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec,
1217 return 0; 1220 return 0;
1218} 1221}
1219 1222
1223static int twl4030_startup(struct snd_pcm_substream *substream,
1224 struct snd_soc_dai *dai)
1225{
1226 struct snd_soc_pcm_runtime *rtd = substream->private_data;
1227 struct snd_soc_device *socdev = rtd->socdev;
1228 struct snd_soc_codec *codec = socdev->card->codec;
1229 struct twl4030_priv *twl4030 = codec->private_data;
1230
1231 /* If we already have a playback or capture going then constrain
1232 * this substream to match it.
1233 */
1234 if (twl4030->master_substream) {
1235 struct snd_pcm_runtime *master_runtime;
1236 master_runtime = twl4030->master_substream->runtime;
1237
1238 snd_pcm_hw_constraint_minmax(substream->runtime,
1239 SNDRV_PCM_HW_PARAM_RATE,
1240 master_runtime->rate,
1241 master_runtime->rate);
1242
1243 snd_pcm_hw_constraint_minmax(substream->runtime,
1244 SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
1245 master_runtime->sample_bits,
1246 master_runtime->sample_bits);
1247
1248 twl4030->slave_substream = substream;
1249 } else
1250 twl4030->master_substream = substream;
1251
1252 return 0;
1253}
1254
1255static void twl4030_shutdown(struct snd_pcm_substream *substream,
1256 struct snd_soc_dai *dai)
1257{
1258 struct snd_soc_pcm_runtime *rtd = substream->private_data;
1259 struct snd_soc_device *socdev = rtd->socdev;
1260 struct snd_soc_codec *codec = socdev->card->codec;
1261 struct twl4030_priv *twl4030 = codec->private_data;
1262
1263 if (twl4030->master_substream == substream)
1264 twl4030->master_substream = twl4030->slave_substream;
1265
1266 twl4030->slave_substream = NULL;
1267}
1268
1220static int twl4030_hw_params(struct snd_pcm_substream *substream, 1269static int twl4030_hw_params(struct snd_pcm_substream *substream,
1221 struct snd_pcm_hw_params *params, 1270 struct snd_pcm_hw_params *params,
1222 struct snd_soc_dai *dai) 1271 struct snd_soc_dai *dai)
@@ -1224,8 +1273,13 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream,
1224 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1273 struct snd_soc_pcm_runtime *rtd = substream->private_data;
1225 struct snd_soc_device *socdev = rtd->socdev; 1274 struct snd_soc_device *socdev = rtd->socdev;
1226 struct snd_soc_codec *codec = socdev->card->codec; 1275 struct snd_soc_codec *codec = socdev->card->codec;
1276 struct twl4030_priv *twl4030 = codec->private_data;
1227 u8 mode, old_mode, format, old_format; 1277 u8 mode, old_mode, format, old_format;
1228 1278
1279 if (substream == twl4030->slave_substream)
1280 /* Ignoring hw_params for slave substream */
1281 return 0;
1282
1229 /* bit rate */ 1283 /* bit rate */
1230 old_mode = twl4030_read_reg_cache(codec, 1284 old_mode = twl4030_read_reg_cache(codec,
1231 TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ; 1285 TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ;
@@ -1259,6 +1313,9 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream,
1259 case 48000: 1313 case 48000:
1260 mode |= TWL4030_APLL_RATE_48000; 1314 mode |= TWL4030_APLL_RATE_48000;
1261 break; 1315 break;
1316 case 96000:
1317 mode |= TWL4030_APLL_RATE_96000;
1318 break;
1262 default: 1319 default:
1263 printk(KERN_ERR "TWL4030 hw params: unknown rate %d\n", 1320 printk(KERN_ERR "TWL4030 hw params: unknown rate %d\n",
1264 params_rate(params)); 1321 params_rate(params));
@@ -1384,6 +1441,8 @@ static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai,
1384#define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE) 1441#define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE)
1385 1442
1386static struct snd_soc_dai_ops twl4030_dai_ops = { 1443static struct snd_soc_dai_ops twl4030_dai_ops = {
1444 .startup = twl4030_startup,
1445 .shutdown = twl4030_shutdown,
1387 .hw_params = twl4030_hw_params, 1446 .hw_params = twl4030_hw_params,
1388 .set_sysclk = twl4030_set_dai_sysclk, 1447 .set_sysclk = twl4030_set_dai_sysclk,
1389 .set_fmt = twl4030_set_dai_fmt, 1448 .set_fmt = twl4030_set_dai_fmt,
@@ -1395,7 +1454,7 @@ struct snd_soc_dai twl4030_dai = {
1395 .stream_name = "Playback", 1454 .stream_name = "Playback",
1396 .channels_min = 2, 1455 .channels_min = 2,
1397 .channels_max = 2, 1456 .channels_max = 2,
1398 .rates = TWL4030_RATES, 1457 .rates = TWL4030_RATES | SNDRV_PCM_RATE_96000,
1399 .formats = TWL4030_FORMATS,}, 1458 .formats = TWL4030_FORMATS,},
1400 .capture = { 1459 .capture = {
1401 .stream_name = "Capture", 1460 .stream_name = "Capture",
diff --git a/sound/soc/codecs/twl4030.h b/sound/soc/codecs/twl4030.h
index 33dbb144dad1..cb63765db1df 100644
--- a/sound/soc/codecs/twl4030.h
+++ b/sound/soc/codecs/twl4030.h
@@ -109,6 +109,7 @@
109#define TWL4030_APLL_RATE_32000 0x80 109#define TWL4030_APLL_RATE_32000 0x80
110#define TWL4030_APLL_RATE_44100 0x90 110#define TWL4030_APLL_RATE_44100 0x90
111#define TWL4030_APLL_RATE_48000 0xA0 111#define TWL4030_APLL_RATE_48000 0xA0
112#define TWL4030_APLL_RATE_96000 0xE0
112#define TWL4030_SEL_16K 0x04 113#define TWL4030_SEL_16K 0x04
113#define TWL4030_CODECPDZ 0x02 114#define TWL4030_CODECPDZ 0x02
114#define TWL4030_OPT_MODE 0x01 115#define TWL4030_OPT_MODE 0x01
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index 3265817c5c26..6e23a81dba78 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -317,6 +317,41 @@ static int wm9705_reset(struct snd_soc_codec *codec)
317 return -EIO; 317 return -EIO;
318} 318}
319 319
320#ifdef CONFIG_PM
321static int wm9705_soc_suspend(struct platform_device *pdev)
322{
323 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
324 struct snd_soc_codec *codec = socdev->card->codec;
325
326 soc_ac97_ops.write(codec->ac97, AC97_POWERDOWN, 0xffff);
327
328 return 0;
329}
330
331static int wm9705_soc_resume(struct platform_device *pdev)
332{
333 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
334 struct snd_soc_codec *codec = socdev->card->codec;
335 int i, ret;
336 u16 *cache = codec->reg_cache;
337
338 ret = wm9705_reset(codec);
339 if (ret < 0) {
340 printk(KERN_ERR "could not reset AC97 codec\n");
341 return ret;
342 }
343
344 for (i = 2; i < ARRAY_SIZE(wm9705_reg) << 1; i += 2) {
345 soc_ac97_ops.write(codec->ac97, i, cache[i>>1]);
346 }
347
348 return 0;
349}
350#else
351#define wm9705_soc_suspend NULL
352#define wm9705_soc_resume NULL
353#endif
354
320static int wm9705_soc_probe(struct platform_device *pdev) 355static int wm9705_soc_probe(struct platform_device *pdev)
321{ 356{
322 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 357 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
@@ -407,6 +442,8 @@ static int wm9705_soc_remove(struct platform_device *pdev)
407struct snd_soc_codec_device soc_codec_dev_wm9705 = { 442struct snd_soc_codec_device soc_codec_dev_wm9705 = {
408 .probe = wm9705_soc_probe, 443 .probe = wm9705_soc_probe,
409 .remove = wm9705_soc_remove, 444 .remove = wm9705_soc_remove,
445 .suspend = wm9705_soc_suspend,
446 .resume = wm9705_soc_resume,
410}; 447};
411EXPORT_SYMBOL_GPL(soc_codec_dev_wm9705); 448EXPORT_SYMBOL_GPL(soc_codec_dev_wm9705);
412 449
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index b3eb8570cd7b..b1a3a278819f 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -300,7 +300,7 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
300 if (!card->dev->coherent_dma_mask) 300 if (!card->dev->coherent_dma_mask)
301 card->dev->coherent_dma_mask = fsl_dma_dmamask; 301 card->dev->coherent_dma_mask = fsl_dma_dmamask;
302 302
303 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev, 303 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
304 fsl_dma_hardware.buffer_bytes_max, 304 fsl_dma_hardware.buffer_bytes_max,
305 &pcm->streams[0].substream->dma_buffer); 305 &pcm->streams[0].substream->dma_buffer);
306 if (ret) { 306 if (ret) {
@@ -310,7 +310,7 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
310 return -ENOMEM; 310 return -ENOMEM;
311 } 311 }
312 312
313 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev, 313 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
314 fsl_dma_hardware.buffer_bytes_max, 314 fsl_dma_hardware.buffer_bytes_max,
315 &pcm->streams[1].substream->dma_buffer); 315 &pcm->streams[1].substream->dma_buffer);
316 if (ret) { 316 if (ret) {
@@ -418,7 +418,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
418 return -EBUSY; 418 return -EBUSY;
419 } 419 }
420 420
421 dma_private = dma_alloc_coherent(substream->pcm->dev, 421 dma_private = dma_alloc_coherent(substream->pcm->card->dev,
422 sizeof(struct fsl_dma_private), &ld_buf_phys, GFP_KERNEL); 422 sizeof(struct fsl_dma_private), &ld_buf_phys, GFP_KERNEL);
423 if (!dma_private) { 423 if (!dma_private) {
424 dev_err(substream->pcm->card->dev, 424 dev_err(substream->pcm->card->dev,
@@ -445,7 +445,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
445 dev_err(substream->pcm->card->dev, 445 dev_err(substream->pcm->card->dev,
446 "can't register ISR for IRQ %u (ret=%i)\n", 446 "can't register ISR for IRQ %u (ret=%i)\n",
447 dma_private->irq, ret); 447 dma_private->irq, ret);
448 dma_free_coherent(substream->pcm->dev, 448 dma_free_coherent(substream->pcm->card->dev,
449 sizeof(struct fsl_dma_private), 449 sizeof(struct fsl_dma_private),
450 dma_private, dma_private->ld_buf_phys); 450 dma_private, dma_private->ld_buf_phys);
451 return ret; 451 return ret;
@@ -697,6 +697,23 @@ static snd_pcm_uframes_t fsl_dma_pointer(struct snd_pcm_substream *substream)
697 else 697 else
698 position = in_be32(&dma_channel->dar); 698 position = in_be32(&dma_channel->dar);
699 699
700 /*
701 * When capture is started, the SSI immediately starts to fill its FIFO.
702 * This means that the DMA controller is not started until the FIFO is
703 * full. However, ALSA calls this function before that happens, when
704 * MR.DAR is still zero. In this case, just return zero to indicate
705 * that nothing has been received yet.
706 */
707 if (!position)
708 return 0;
709
710 if ((position < dma_private->dma_buf_phys) ||
711 (position > dma_private->dma_buf_end)) {
712 dev_err(substream->pcm->card->dev,
713 "dma pointer is out of range, halting stream\n");
714 return SNDRV_PCM_POS_XRUN;
715 }
716
700 frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys); 717 frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys);
701 718
702 /* 719 /*
@@ -761,13 +778,13 @@ static int fsl_dma_close(struct snd_pcm_substream *substream)
761 free_irq(dma_private->irq, dma_private); 778 free_irq(dma_private->irq, dma_private);
762 779
763 if (dma_private->ld_buf_phys) { 780 if (dma_private->ld_buf_phys) {
764 dma_unmap_single(substream->pcm->dev, 781 dma_unmap_single(substream->pcm->card->dev,
765 dma_private->ld_buf_phys, 782 dma_private->ld_buf_phys,
766 sizeof(dma_private->link), DMA_TO_DEVICE); 783 sizeof(dma_private->link), DMA_TO_DEVICE);
767 } 784 }
768 785
769 /* Deallocate the fsl_dma_private structure */ 786 /* Deallocate the fsl_dma_private structure */
770 dma_free_coherent(substream->pcm->dev, 787 dma_free_coherent(substream->pcm->card->dev,
771 sizeof(struct fsl_dma_private), 788 sizeof(struct fsl_dma_private),
772 dma_private, dma_private->ld_buf_phys); 789 dma_private, dma_private->ld_buf_phys);
773 substream->runtime->private_data = NULL; 790 substream->runtime->private_data = NULL;
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 169bca295b78..3711d8454d96 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -60,6 +60,13 @@
60 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE) 60 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE)
61#endif 61#endif
62 62
63/* SIER bitflag of interrupts to enable */
64#define SIER_FLAGS (CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE | \
65 CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TUE0_EN | \
66 CCSR_SSI_SIER_TUE1_EN | CCSR_SSI_SIER_RFRC_EN | \
67 CCSR_SSI_SIER_RDMAE | CCSR_SSI_SIER_RIE | \
68 CCSR_SSI_SIER_ROE0_EN | CCSR_SSI_SIER_ROE1_EN)
69
63/** 70/**
64 * fsl_ssi_private: per-SSI private data 71 * fsl_ssi_private: per-SSI private data
65 * 72 *
@@ -140,7 +147,7 @@ static irqreturn_t fsl_ssi_isr(int irq, void *dev_id)
140 were interrupted for. We mask it with the Interrupt Enable register 147 were interrupted for. We mask it with the Interrupt Enable register
141 so that we only check for events that we're interested in. 148 so that we only check for events that we're interested in.
142 */ 149 */
143 sisr = in_be32(&ssi->sisr) & in_be32(&ssi->sier); 150 sisr = in_be32(&ssi->sisr) & SIER_FLAGS;
144 151
145 if (sisr & CCSR_SSI_SISR_RFRC) { 152 if (sisr & CCSR_SSI_SISR_RFRC) {
146 ssi_private->stats.rfrc++; 153 ssi_private->stats.rfrc++;
@@ -324,12 +331,7 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
324 */ 331 */
325 332
326 /* 4. Enable the interrupts and DMA requests */ 333 /* 4. Enable the interrupts and DMA requests */
327 out_be32(&ssi->sier, 334 out_be32(&ssi->sier, SIER_FLAGS);
328 CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE |
329 CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TUE0_EN |
330 CCSR_SSI_SIER_TUE1_EN | CCSR_SSI_SIER_RFRC_EN |
331 CCSR_SSI_SIER_RDMAE | CCSR_SSI_SIER_RIE |
332 CCSR_SSI_SIER_ROE0_EN | CCSR_SSI_SIER_ROE1_EN);
333 335
334 /* 336 /*
335 * Set the watermark for transmit FIFI 0 and receive FIFO 0. We 337 * Set the watermark for transmit FIFI 0 and receive FIFO 0. We
@@ -466,28 +468,12 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
466 case SNDRV_PCM_TRIGGER_START: 468 case SNDRV_PCM_TRIGGER_START:
467 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); 469 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
468 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 470 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
469 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 471 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
470 setbits32(&ssi->scr, 472 setbits32(&ssi->scr,
471 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE); 473 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE);
472 } else { 474 else
473 long timeout = jiffies + 10;
474
475 setbits32(&ssi->scr, 475 setbits32(&ssi->scr,
476 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE); 476 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
477
478 /* Wait until the SSI has filled its FIFO. Without this
479 * delay, ALSA complains about overruns. When the FIFO
480 * is full, the DMA controller initiates its first
481 * transfer. Until then, however, the DMA's DAR
482 * register is zero, which translates to an
483 * out-of-bounds pointer. This makes ALSA think an
484 * overrun has occurred.
485 */
486 while (!(in_be32(&ssi->sisr) & CCSR_SSI_SISR_RFF0) &&
487 (jiffies < timeout));
488 if (!(in_be32(&ssi->sisr) & CCSR_SSI_SISR_RFF0))
489 return -EIO;
490 }
491 break; 477 break;
492 478
493 case SNDRV_PCM_TRIGGER_STOP: 479 case SNDRV_PCM_TRIGGER_STOP:
@@ -606,39 +592,52 @@ static struct snd_soc_dai fsl_ssi_dai_template = {
606 .ops = &fsl_ssi_dai_ops, 592 .ops = &fsl_ssi_dai_ops,
607}; 593};
608 594
595/* Show the statistics of a flag only if its interrupt is enabled. The
596 * compiler will optimze this code to a no-op if the interrupt is not
597 * enabled.
598 */
599#define SIER_SHOW(flag, name) \
600 do { \
601 if (SIER_FLAGS & CCSR_SSI_SIER_##flag) \
602 length += sprintf(buf + length, #name "=%u\n", \
603 ssi_private->stats.name); \
604 } while (0)
605
606
609/** 607/**
610 * fsl_sysfs_ssi_show: display SSI statistics 608 * fsl_sysfs_ssi_show: display SSI statistics
611 * 609 *
612 * Display the statistics for the current SSI device. 610 * Display the statistics for the current SSI device. To avoid confusion,
611 * we only show those counts that are enabled.
613 */ 612 */
614static ssize_t fsl_sysfs_ssi_show(struct device *dev, 613static ssize_t fsl_sysfs_ssi_show(struct device *dev,
615 struct device_attribute *attr, char *buf) 614 struct device_attribute *attr, char *buf)
616{ 615{
617 struct fsl_ssi_private *ssi_private = 616 struct fsl_ssi_private *ssi_private =
618 container_of(attr, struct fsl_ssi_private, dev_attr); 617 container_of(attr, struct fsl_ssi_private, dev_attr);
619 ssize_t length; 618 ssize_t length = 0;
620 619
621 length = sprintf(buf, "rfrc=%u", ssi_private->stats.rfrc); 620 SIER_SHOW(RFRC_EN, rfrc);
622 length += sprintf(buf + length, "\ttfrc=%u", ssi_private->stats.tfrc); 621 SIER_SHOW(TFRC_EN, tfrc);
623 length += sprintf(buf + length, "\tcmdau=%u", ssi_private->stats.cmdau); 622 SIER_SHOW(CMDAU_EN, cmdau);
624 length += sprintf(buf + length, "\tcmddu=%u", ssi_private->stats.cmddu); 623 SIER_SHOW(CMDDU_EN, cmddu);
625 length += sprintf(buf + length, "\trxt=%u", ssi_private->stats.rxt); 624 SIER_SHOW(RXT_EN, rxt);
626 length += sprintf(buf + length, "\trdr1=%u", ssi_private->stats.rdr1); 625 SIER_SHOW(RDR1_EN, rdr1);
627 length += sprintf(buf + length, "\trdr0=%u", ssi_private->stats.rdr0); 626 SIER_SHOW(RDR0_EN, rdr0);
628 length += sprintf(buf + length, "\ttde1=%u", ssi_private->stats.tde1); 627 SIER_SHOW(TDE1_EN, tde1);
629 length += sprintf(buf + length, "\ttde0=%u", ssi_private->stats.tde0); 628 SIER_SHOW(TDE0_EN, tde0);
630 length += sprintf(buf + length, "\troe1=%u", ssi_private->stats.roe1); 629 SIER_SHOW(ROE1_EN, roe1);
631 length += sprintf(buf + length, "\troe0=%u", ssi_private->stats.roe0); 630 SIER_SHOW(ROE0_EN, roe0);
632 length += sprintf(buf + length, "\ttue1=%u", ssi_private->stats.tue1); 631 SIER_SHOW(TUE1_EN, tue1);
633 length += sprintf(buf + length, "\ttue0=%u", ssi_private->stats.tue0); 632 SIER_SHOW(TUE0_EN, tue0);
634 length += sprintf(buf + length, "\ttfs=%u", ssi_private->stats.tfs); 633 SIER_SHOW(TFS_EN, tfs);
635 length += sprintf(buf + length, "\trfs=%u", ssi_private->stats.rfs); 634 SIER_SHOW(RFS_EN, rfs);
636 length += sprintf(buf + length, "\ttls=%u", ssi_private->stats.tls); 635 SIER_SHOW(TLS_EN, tls);
637 length += sprintf(buf + length, "\trls=%u", ssi_private->stats.rls); 636 SIER_SHOW(RLS_EN, rls);
638 length += sprintf(buf + length, "\trff1=%u", ssi_private->stats.rff1); 637 SIER_SHOW(RFF1_EN, rff1);
639 length += sprintf(buf + length, "\trff0=%u", ssi_private->stats.rff0); 638 SIER_SHOW(RFF0_EN, rff0);
640 length += sprintf(buf + length, "\ttfe1=%u", ssi_private->stats.tfe1); 639 SIER_SHOW(TFE1_EN, tfe1);
641 length += sprintf(buf + length, "\ttfe0=%u\n", ssi_private->stats.tfe0); 640 SIER_SHOW(TFE0_EN, tfe0);
642 641
643 return length; 642 return length;
644} 643}
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index d6882be33452..90f4df7fd906 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -146,6 +146,17 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
146 struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data); 146 struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
147 int err = 0; 147 int err = 0;
148 148
149 if (cpu_is_omap343x() && mcbsp_data->bus_id == 1) {
150 /*
151 * McBSP2 in OMAP3 has 1024 * 32-bit internal audio buffer.
152 * Set constraint for minimum buffer size to the same than FIFO
153 * size in order to avoid underruns in playback startup because
154 * HW is keeping the DMA request active until FIFO is filled.
155 */
156 snd_pcm_hw_constraint_minmax(substream->runtime,
157 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4096, UINT_MAX);
158 }
159
149 if (!cpu_dai->active) 160 if (!cpu_dai->active)
150 err = omap_mcbsp_request(mcbsp_data->bus_id); 161 err = omap_mcbsp_request(mcbsp_data->bus_id);
151 162
@@ -272,7 +283,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
272 break; 283 break;
273 case SND_SOC_DAIFMT_DSP_B: 284 case SND_SOC_DAIFMT_DSP_B:
274 regs->srgr2 |= FPER(wlen * channels - 1); 285 regs->srgr2 |= FPER(wlen * channels - 1);
275 regs->srgr1 |= FWID(wlen * channels - 2); 286 regs->srgr1 |= FWID(0);
276 break; 287 break;
277 } 288 }
278 289
@@ -291,6 +302,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
291{ 302{
292 struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data); 303 struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
293 struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; 304 struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
305 unsigned int temp_fmt = fmt;
294 306
295 if (mcbsp_data->configured) 307 if (mcbsp_data->configured)
296 return 0; 308 return 0;
@@ -317,6 +329,8 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
317 /* 0-bit data delay */ 329 /* 0-bit data delay */
318 regs->rcr2 |= RDATDLY(0); 330 regs->rcr2 |= RDATDLY(0);
319 regs->xcr2 |= XDATDLY(0); 331 regs->xcr2 |= XDATDLY(0);
332 /* Invert FS polarity configuration */
333 temp_fmt ^= SND_SOC_DAIFMT_NB_IF;
320 break; 334 break;
321 default: 335 default:
322 /* Unsupported data format */ 336 /* Unsupported data format */
@@ -340,7 +354,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
340 } 354 }
341 355
342 /* Set bit clock (CLKX/CLKR) and FS polarities */ 356 /* Set bit clock (CLKX/CLKR) and FS polarities */
343 switch (fmt & SND_SOC_DAIFMT_INV_MASK) { 357 switch (temp_fmt & SND_SOC_DAIFMT_INV_MASK) {
344 case SND_SOC_DAIFMT_NB_NF: 358 case SND_SOC_DAIFMT_NB_NF:
345 /* 359 /*
346 * Normal BCLK + FS. 360 * Normal BCLK + FS.
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 8e1431cb46bb..1bdbb0427183 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -327,7 +327,7 @@ int omap_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
327 if (!card->dev->dma_mask) 327 if (!card->dev->dma_mask)
328 card->dev->dma_mask = &omap_pcm_dmamask; 328 card->dev->dma_mask = &omap_pcm_dmamask;
329 if (!card->dev->coherent_dma_mask) 329 if (!card->dev->coherent_dma_mask)
330 card->dev->coherent_dma_mask = DMA_32BIT_MASK; 330 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
331 331
332 if (dai->playback.channels_min) { 332 if (dai->playback.channels_min) {
333 ret = omap_pcm_preallocate_dma_buffer(pcm, 333 ret = omap_pcm_preallocate_dma_buffer(pcm,
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index a952a4eb3361..a4e149b7f0eb 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -62,7 +62,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream,
62 /* Set codec DAI configuration */ 62 /* Set codec DAI configuration */
63 err = snd_soc_dai_set_fmt(codec_dai, 63 err = snd_soc_dai_set_fmt(codec_dai,
64 SND_SOC_DAIFMT_DSP_B | 64 SND_SOC_DAIFMT_DSP_B |
65 SND_SOC_DAIFMT_NB_IF | 65 SND_SOC_DAIFMT_NB_NF |
66 SND_SOC_DAIFMT_CBM_CFM); 66 SND_SOC_DAIFMT_CBM_CFM);
67 if (err < 0) { 67 if (err < 0) {
68 printk(KERN_ERR "can't set codec DAI configuration\n"); 68 printk(KERN_ERR "can't set codec DAI configuration\n");
@@ -72,7 +72,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream,
72 /* Set cpu DAI configuration */ 72 /* Set cpu DAI configuration */
73 err = snd_soc_dai_set_fmt(cpu_dai, 73 err = snd_soc_dai_set_fmt(cpu_dai,
74 SND_SOC_DAIFMT_DSP_B | 74 SND_SOC_DAIFMT_DSP_B |
75 SND_SOC_DAIFMT_NB_IF | 75 SND_SOC_DAIFMT_NB_NF |
76 SND_SOC_DAIFMT_CBM_CFM); 76 SND_SOC_DAIFMT_CBM_CFM);
77 if (err < 0) { 77 if (err < 0) {
78 printk(KERN_ERR "can't set cpu DAI configuration\n"); 78 printk(KERN_ERR "can't set cpu DAI configuration\n");
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 5998ab366e83..ad8a10fe6298 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -116,6 +116,16 @@ config SND_SOC_ZYLONITE
116 Say Y if you want to add support for SoC audio on the 116 Say Y if you want to add support for SoC audio on the
117 Marvell Zylonite reference platform. 117 Marvell Zylonite reference platform.
118 118
119config SND_PXA2XX_SOC_MAGICIAN
120 tristate "SoC Audio support for HTC Magician"
121 depends on SND_PXA2XX_SOC && MACH_MAGICIAN
122 select SND_PXA2XX_SOC_I2S
123 select SND_PXA_SOC_SSP
124 select SND_SOC_UDA1380
125 help
126 Say Y if you want to add support for SoC audio on the
127 HTC Magician.
128
119config SND_PXA2XX_SOC_MIOA701 129config SND_PXA2XX_SOC_MIOA701
120 tristate "SoC Audio support for MIO A701" 130 tristate "SoC Audio support for MIO A701"
121 depends on SND_PXA2XX_SOC && MACH_MIOA701 131 depends on SND_PXA2XX_SOC && MACH_MIOA701
diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile
index 8ed881c5e5cc..4b90c3ccae45 100644
--- a/sound/soc/pxa/Makefile
+++ b/sound/soc/pxa/Makefile
@@ -20,6 +20,7 @@ snd-soc-spitz-objs := spitz.o
20snd-soc-em-x270-objs := em-x270.o 20snd-soc-em-x270-objs := em-x270.o
21snd-soc-palm27x-objs := palm27x.o 21snd-soc-palm27x-objs := palm27x.o
22snd-soc-zylonite-objs := zylonite.o 22snd-soc-zylonite-objs := zylonite.o
23snd-soc-magician-objs := magician.o
23snd-soc-mioa701-objs := mioa701_wm9713.o 24snd-soc-mioa701-objs := mioa701_wm9713.o
24 25
25obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o 26obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o
@@ -31,5 +32,6 @@ obj-$(CONFIG_SND_PXA2XX_SOC_E800) += snd-soc-e800.o
31obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o 32obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o
32obj-$(CONFIG_SND_PXA2XX_SOC_EM_X270) += snd-soc-em-x270.o 33obj-$(CONFIG_SND_PXA2XX_SOC_EM_X270) += snd-soc-em-x270.o
33obj-$(CONFIG_SND_PXA2XX_SOC_PALM27X) += snd-soc-palm27x.o 34obj-$(CONFIG_SND_PXA2XX_SOC_PALM27X) += snd-soc-palm27x.o
35obj-$(CONFIG_SND_PXA2XX_SOC_MAGICIAN) += snd-soc-magician.o
34obj-$(CONFIG_SND_PXA2XX_SOC_MIOA701) += snd-soc-mioa701.o 36obj-$(CONFIG_SND_PXA2XX_SOC_MIOA701) += snd-soc-mioa701.o
35obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o 37obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c
new file mode 100644
index 000000000000..0625c342a1c9
--- /dev/null
+++ b/sound/soc/pxa/magician.c
@@ -0,0 +1,558 @@
1/*
2 * SoC audio for HTC Magician
3 *
4 * Copyright (c) 2006 Philipp Zabel <philipp.zabel@gmail.com>
5 *
6 * based on spitz.c,
7 * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
8 * Richard Purdie <richard@openedhand.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16
17#include <linux/module.h>
18#include <linux/timer.h>
19#include <linux/interrupt.h>
20#include <linux/platform_device.h>
21#include <linux/delay.h>
22#include <linux/gpio.h>
23
24#include <sound/core.h>
25#include <sound/pcm.h>
26#include <sound/pcm_params.h>
27#include <sound/soc.h>
28#include <sound/soc-dapm.h>
29
30#include <mach/magician.h>
31#include <asm/mach-types.h>
32#include "../codecs/uda1380.h"
33#include "pxa2xx-pcm.h"
34#include "pxa2xx-i2s.h"
35#include "pxa-ssp.h"
36
37#define MAGICIAN_MIC 0
38#define MAGICIAN_MIC_EXT 1
39
40static int magician_hp_switch;
41static int magician_spk_switch = 1;
42static int magician_in_sel = MAGICIAN_MIC;
43
44static void magician_ext_control(struct snd_soc_codec *codec)
45{
46 if (magician_spk_switch)
47 snd_soc_dapm_enable_pin(codec, "Speaker");
48 else
49 snd_soc_dapm_disable_pin(codec, "Speaker");
50 if (magician_hp_switch)
51 snd_soc_dapm_enable_pin(codec, "Headphone Jack");
52 else
53 snd_soc_dapm_disable_pin(codec, "Headphone Jack");
54
55 switch (magician_in_sel) {
56 case MAGICIAN_MIC:
57 snd_soc_dapm_disable_pin(codec, "Headset Mic");
58 snd_soc_dapm_enable_pin(codec, "Call Mic");
59 break;
60 case MAGICIAN_MIC_EXT:
61 snd_soc_dapm_disable_pin(codec, "Call Mic");
62 snd_soc_dapm_enable_pin(codec, "Headset Mic");
63 break;
64 }
65
66 snd_soc_dapm_sync(codec);
67}
68
69static int magician_startup(struct snd_pcm_substream *substream)
70{
71 struct snd_soc_pcm_runtime *rtd = substream->private_data;
72 struct snd_soc_codec *codec = rtd->socdev->card->codec;
73
74 /* check the jack status at stream startup */
75 magician_ext_control(codec);
76
77 return 0;
78}
79
80/*
81 * Magician uses SSP port for playback.
82 */
83static int magician_playback_hw_params(struct snd_pcm_substream *substream,
84 struct snd_pcm_hw_params *params)
85{
86 struct snd_soc_pcm_runtime *rtd = substream->private_data;
87 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
88 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
89 unsigned int acps, acds, width, rate;
90 unsigned int div4 = PXA_SSP_CLK_SCDB_4;
91 int ret = 0;
92
93 rate = params_rate(params);
94 width = snd_pcm_format_physical_width(params_format(params));
95
96 /*
97 * rate = SSPSCLK / (2 * width(16 or 32))
98 * SSPSCLK = (ACPS / ACDS) / SSPSCLKDIV(div4 or div1)
99 */
100 switch (params_rate(params)) {
101 case 8000:
102 /* off by a factor of 2: bug in the PXA27x audio clock? */
103 acps = 32842000;
104 switch (width) {
105 case 16:
106 /* 513156 Hz ~= _2_ * 8000 Hz * 32 (+0.23%) */
107 acds = PXA_SSP_CLK_AUDIO_DIV_16;
108 break;
109 case 32:
110 /* 1026312 Hz ~= _2_ * 8000 Hz * 64 (+0.23%) */
111 acds = PXA_SSP_CLK_AUDIO_DIV_8;
112 }
113 break;
114 case 11025:
115 acps = 5622000;
116 switch (width) {
117 case 16:
118 /* 351375 Hz ~= 11025 Hz * 32 (-0.41%) */
119 acds = PXA_SSP_CLK_AUDIO_DIV_4;
120 break;
121 case 32:
122 /* 702750 Hz ~= 11025 Hz * 64 (-0.41%) */
123 acds = PXA_SSP_CLK_AUDIO_DIV_2;
124 }
125 break;
126 case 22050:
127 acps = 5622000;
128 switch (width) {
129 case 16:
130 /* 702750 Hz ~= 22050 Hz * 32 (-0.41%) */
131 acds = PXA_SSP_CLK_AUDIO_DIV_2;
132 break;
133 case 32:
134 /* 1405500 Hz ~= 22050 Hz * 64 (-0.41%) */
135 acds = PXA_SSP_CLK_AUDIO_DIV_1;
136 }
137 break;
138 case 44100:
139 acps = 5622000;
140 switch (width) {
141 case 16:
142 /* 1405500 Hz ~= 44100 Hz * 32 (-0.41%) */
143 acds = PXA_SSP_CLK_AUDIO_DIV_2;
144 break;
145 case 32:
146 /* 2811000 Hz ~= 44100 Hz * 64 (-0.41%) */
147 acds = PXA_SSP_CLK_AUDIO_DIV_1;
148 }
149 break;
150 case 48000:
151 acps = 12235000;
152 switch (width) {
153 case 16:
154 /* 1529375 Hz ~= 48000 Hz * 32 (-0.44%) */
155 acds = PXA_SSP_CLK_AUDIO_DIV_2;
156 break;
157 case 32:
158 /* 3058750 Hz ~= 48000 Hz * 64 (-0.44%) */
159 acds = PXA_SSP_CLK_AUDIO_DIV_1;
160 }
161 break;
162 case 96000:
163 acps = 12235000;
164 switch (width) {
165 case 16:
166 /* 3058750 Hz ~= 96000 Hz * 32 (-0.44%) */
167 acds = PXA_SSP_CLK_AUDIO_DIV_1;
168 break;
169 case 32:
170 /* 6117500 Hz ~= 96000 Hz * 64 (-0.44%) */
171 acds = PXA_SSP_CLK_AUDIO_DIV_2;
172 div4 = PXA_SSP_CLK_SCDB_1;
173 break;
174 }
175 break;
176 }
177
178 /* set codec DAI configuration */
179 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_MSB |
180 SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
181 if (ret < 0)
182 return ret;
183
184 /* set cpu DAI configuration */
185 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
186 SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBS_CFS);
187 if (ret < 0)
188 return ret;
189
190 ret = snd_soc_dai_set_tdm_slot(cpu_dai, 1, 1);
191 if (ret < 0)
192 return ret;
193
194 /* set audio clock as clock source */
195 ret = snd_soc_dai_set_sysclk(cpu_dai, PXA_SSP_CLK_AUDIO, 0,
196 SND_SOC_CLOCK_OUT);
197 if (ret < 0)
198 return ret;
199
200 /* set the SSP audio system clock ACDS divider */
201 ret = snd_soc_dai_set_clkdiv(cpu_dai,
202 PXA_SSP_AUDIO_DIV_ACDS, acds);
203 if (ret < 0)
204 return ret;
205
206 /* set the SSP audio system clock SCDB divider4 */
207 ret = snd_soc_dai_set_clkdiv(cpu_dai,
208 PXA_SSP_AUDIO_DIV_SCDB, div4);
209 if (ret < 0)
210 return ret;
211
212 /* set SSP audio pll clock */
213 ret = snd_soc_dai_set_pll(cpu_dai, 0, 0, acps);
214 if (ret < 0)
215 return ret;
216
217 return 0;
218}
219
220/*
221 * Magician uses I2S for capture.
222 */
223static int magician_capture_hw_params(struct snd_pcm_substream *substream,
224 struct snd_pcm_hw_params *params)
225{
226 struct snd_soc_pcm_runtime *rtd = substream->private_data;
227 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
228 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
229 int ret = 0;
230
231 /* set codec DAI configuration */
232 ret = snd_soc_dai_set_fmt(codec_dai,
233 SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF |
234 SND_SOC_DAIFMT_CBS_CFS);
235 if (ret < 0)
236 return ret;
237
238 /* set cpu DAI configuration */
239 ret = snd_soc_dai_set_fmt(cpu_dai,
240 SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF |
241 SND_SOC_DAIFMT_CBS_CFS);
242 if (ret < 0)
243 return ret;
244
245 /* set the I2S system clock as output */
246 ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0,
247 SND_SOC_CLOCK_OUT);
248 if (ret < 0)
249 return ret;
250
251 return 0;
252}
253
254static struct snd_soc_ops magician_capture_ops = {
255 .startup = magician_startup,
256 .hw_params = magician_capture_hw_params,
257};
258
259static struct snd_soc_ops magician_playback_ops = {
260 .startup = magician_startup,
261 .hw_params = magician_playback_hw_params,
262};
263
264static int magician_get_hp(struct snd_kcontrol *kcontrol,
265 struct snd_ctl_elem_value *ucontrol)
266{
267 ucontrol->value.integer.value[0] = magician_hp_switch;
268 return 0;
269}
270
271static int magician_set_hp(struct snd_kcontrol *kcontrol,
272 struct snd_ctl_elem_value *ucontrol)
273{
274 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
275
276 if (magician_hp_switch == ucontrol->value.integer.value[0])
277 return 0;
278
279 magician_hp_switch = ucontrol->value.integer.value[0];
280 magician_ext_control(codec);
281 return 1;
282}
283
284static int magician_get_spk(struct snd_kcontrol *kcontrol,
285 struct snd_ctl_elem_value *ucontrol)
286{
287 ucontrol->value.integer.value[0] = magician_spk_switch;
288 return 0;
289}
290
291static int magician_set_spk(struct snd_kcontrol *kcontrol,
292 struct snd_ctl_elem_value *ucontrol)
293{
294 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
295
296 if (magician_spk_switch == ucontrol->value.integer.value[0])
297 return 0;
298
299 magician_spk_switch = ucontrol->value.integer.value[0];
300 magician_ext_control(codec);
301 return 1;
302}
303
304static int magician_get_input(struct snd_kcontrol *kcontrol,
305 struct snd_ctl_elem_value *ucontrol)
306{
307 ucontrol->value.integer.value[0] = magician_in_sel;
308 return 0;
309}
310
311static int magician_set_input(struct snd_kcontrol *kcontrol,
312 struct snd_ctl_elem_value *ucontrol)
313{
314 if (magician_in_sel == ucontrol->value.integer.value[0])
315 return 0;
316
317 magician_in_sel = ucontrol->value.integer.value[0];
318
319 switch (magician_in_sel) {
320 case MAGICIAN_MIC:
321 gpio_set_value(EGPIO_MAGICIAN_IN_SEL1, 1);
322 break;
323 case MAGICIAN_MIC_EXT:
324 gpio_set_value(EGPIO_MAGICIAN_IN_SEL1, 0);
325 }
326
327 return 1;
328}
329
330static int magician_spk_power(struct snd_soc_dapm_widget *w,
331 struct snd_kcontrol *k, int event)
332{
333 gpio_set_value(EGPIO_MAGICIAN_SPK_POWER, SND_SOC_DAPM_EVENT_ON(event));
334 return 0;
335}
336
337static int magician_hp_power(struct snd_soc_dapm_widget *w,
338 struct snd_kcontrol *k, int event)
339{
340 gpio_set_value(EGPIO_MAGICIAN_EP_POWER, SND_SOC_DAPM_EVENT_ON(event));
341 return 0;
342}
343
344static int magician_mic_bias(struct snd_soc_dapm_widget *w,
345 struct snd_kcontrol *k, int event)
346{
347 gpio_set_value(EGPIO_MAGICIAN_MIC_POWER, SND_SOC_DAPM_EVENT_ON(event));
348 return 0;
349}
350
351/* magician machine dapm widgets */
352static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = {
353 SND_SOC_DAPM_HP("Headphone Jack", magician_hp_power),
354 SND_SOC_DAPM_SPK("Speaker", magician_spk_power),
355 SND_SOC_DAPM_MIC("Call Mic", magician_mic_bias),
356 SND_SOC_DAPM_MIC("Headset Mic", magician_mic_bias),
357};
358
359/* magician machine audio_map */
360static const struct snd_soc_dapm_route audio_map[] = {
361
362 /* Headphone connected to VOUTL, VOUTR */
363 {"Headphone Jack", NULL, "VOUTL"},
364 {"Headphone Jack", NULL, "VOUTR"},
365
366 /* Speaker connected to VOUTL, VOUTR */
367 {"Speaker", NULL, "VOUTL"},
368 {"Speaker", NULL, "VOUTR"},
369
370 /* Mics are connected to VINM */
371 {"VINM", NULL, "Headset Mic"},
372 {"VINM", NULL, "Call Mic"},
373};
374
375static const char *input_select[] = {"Call Mic", "Headset Mic"};
376static const struct soc_enum magician_in_sel_enum =
377 SOC_ENUM_SINGLE_EXT(2, input_select);
378
379static const struct snd_kcontrol_new uda1380_magician_controls[] = {
380 SOC_SINGLE_BOOL_EXT("Headphone Switch",
381 (unsigned long)&magician_hp_switch,
382 magician_get_hp, magician_set_hp),
383 SOC_SINGLE_BOOL_EXT("Speaker Switch",
384 (unsigned long)&magician_spk_switch,
385 magician_get_spk, magician_set_spk),
386 SOC_ENUM_EXT("Input Select", magician_in_sel_enum,
387 magician_get_input, magician_set_input),
388};
389
390/*
391 * Logic for a uda1380 as connected on a HTC Magician
392 */
393static int magician_uda1380_init(struct snd_soc_codec *codec)
394{
395 int err;
396
397 /* NC codec pins */
398 snd_soc_dapm_nc_pin(codec, "VOUTLHP");
399 snd_soc_dapm_nc_pin(codec, "VOUTRHP");
400
401 /* FIXME: is anything connected here? */
402 snd_soc_dapm_nc_pin(codec, "VINL");
403 snd_soc_dapm_nc_pin(codec, "VINR");
404
405 /* Add magician specific controls */
406 err = snd_soc_add_controls(codec, uda1380_magician_controls,
407 ARRAY_SIZE(uda1380_magician_controls));
408 if (err < 0)
409 return err;
410
411 /* Add magician specific widgets */
412 snd_soc_dapm_new_controls(codec, uda1380_dapm_widgets,
413 ARRAY_SIZE(uda1380_dapm_widgets));
414
415 /* Set up magician specific audio path interconnects */
416 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
417
418 snd_soc_dapm_sync(codec);
419 return 0;
420}
421
422/* magician digital audio interface glue - connects codec <--> CPU */
423static struct snd_soc_dai_link magician_dai[] = {
424{
425 .name = "uda1380",
426 .stream_name = "UDA1380 Playback",
427 .cpu_dai = &pxa_ssp_dai[PXA_DAI_SSP1],
428 .codec_dai = &uda1380_dai[UDA1380_DAI_PLAYBACK],
429 .init = magician_uda1380_init,
430 .ops = &magician_playback_ops,
431},
432{
433 .name = "uda1380",
434 .stream_name = "UDA1380 Capture",
435 .cpu_dai = &pxa_i2s_dai,
436 .codec_dai = &uda1380_dai[UDA1380_DAI_CAPTURE],
437 .ops = &magician_capture_ops,
438}
439};
440
441/* magician audio machine driver */
442static struct snd_soc_card snd_soc_card_magician = {
443 .name = "Magician",
444 .dai_link = magician_dai,
445 .num_links = ARRAY_SIZE(magician_dai),
446 .platform = &pxa2xx_soc_platform,
447};
448
449/* magician audio private data */
450static struct uda1380_setup_data magician_uda1380_setup = {
451 .i2c_address = 0x18,
452 .dac_clk = UDA1380_DAC_CLK_WSPLL,
453};
454
455/* magician audio subsystem */
456static struct snd_soc_device magician_snd_devdata = {
457 .card = &snd_soc_card_magician,
458 .codec_dev = &soc_codec_dev_uda1380,
459 .codec_data = &magician_uda1380_setup,
460};
461
462static struct platform_device *magician_snd_device;
463
464static int __init magician_init(void)
465{
466 int ret;
467
468 if (!machine_is_magician())
469 return -ENODEV;
470
471 ret = gpio_request(EGPIO_MAGICIAN_CODEC_POWER, "CODEC_POWER");
472 if (ret)
473 goto err_request_power;
474 ret = gpio_request(EGPIO_MAGICIAN_CODEC_RESET, "CODEC_RESET");
475 if (ret)
476 goto err_request_reset;
477 ret = gpio_request(EGPIO_MAGICIAN_SPK_POWER, "SPK_POWER");
478 if (ret)
479 goto err_request_spk;
480 ret = gpio_request(EGPIO_MAGICIAN_EP_POWER, "EP_POWER");
481 if (ret)
482 goto err_request_ep;
483 ret = gpio_request(EGPIO_MAGICIAN_MIC_POWER, "MIC_POWER");
484 if (ret)
485 goto err_request_mic;
486 ret = gpio_request(EGPIO_MAGICIAN_IN_SEL0, "IN_SEL0");
487 if (ret)
488 goto err_request_in_sel0;
489 ret = gpio_request(EGPIO_MAGICIAN_IN_SEL1, "IN_SEL1");
490 if (ret)
491 goto err_request_in_sel1;
492
493 gpio_set_value(EGPIO_MAGICIAN_CODEC_POWER, 1);
494 gpio_set_value(EGPIO_MAGICIAN_IN_SEL0, 0);
495
496 /* we may need to have the clock running here - pH5 */
497 gpio_set_value(EGPIO_MAGICIAN_CODEC_RESET, 1);
498 udelay(5);
499 gpio_set_value(EGPIO_MAGICIAN_CODEC_RESET, 0);
500
501 magician_snd_device = platform_device_alloc("soc-audio", -1);
502 if (!magician_snd_device) {
503 ret = -ENOMEM;
504 goto err_pdev;
505 }
506
507 platform_set_drvdata(magician_snd_device, &magician_snd_devdata);
508 magician_snd_devdata.dev = &magician_snd_device->dev;
509 ret = platform_device_add(magician_snd_device);
510 if (ret) {
511 platform_device_put(magician_snd_device);
512 goto err_pdev;
513 }
514
515 return 0;
516
517err_pdev:
518 gpio_free(EGPIO_MAGICIAN_IN_SEL1);
519err_request_in_sel1:
520 gpio_free(EGPIO_MAGICIAN_IN_SEL0);
521err_request_in_sel0:
522 gpio_free(EGPIO_MAGICIAN_MIC_POWER);
523err_request_mic:
524 gpio_free(EGPIO_MAGICIAN_EP_POWER);
525err_request_ep:
526 gpio_free(EGPIO_MAGICIAN_SPK_POWER);
527err_request_spk:
528 gpio_free(EGPIO_MAGICIAN_CODEC_RESET);
529err_request_reset:
530 gpio_free(EGPIO_MAGICIAN_CODEC_POWER);
531err_request_power:
532 return ret;
533}
534
535static void __exit magician_exit(void)
536{
537 platform_device_unregister(magician_snd_device);
538
539 gpio_set_value(EGPIO_MAGICIAN_SPK_POWER, 0);
540 gpio_set_value(EGPIO_MAGICIAN_EP_POWER, 0);
541 gpio_set_value(EGPIO_MAGICIAN_MIC_POWER, 0);
542 gpio_set_value(EGPIO_MAGICIAN_CODEC_POWER, 0);
543
544 gpio_free(EGPIO_MAGICIAN_IN_SEL1);
545 gpio_free(EGPIO_MAGICIAN_IN_SEL0);
546 gpio_free(EGPIO_MAGICIAN_MIC_POWER);
547 gpio_free(EGPIO_MAGICIAN_EP_POWER);
548 gpio_free(EGPIO_MAGICIAN_SPK_POWER);
549 gpio_free(EGPIO_MAGICIAN_CODEC_RESET);
550 gpio_free(EGPIO_MAGICIAN_CODEC_POWER);
551}
552
553module_init(magician_init);
554module_exit(magician_exit);
555
556MODULE_AUTHOR("Philipp Zabel");
557MODULE_DESCRIPTION("ALSA SoC Magician");
558MODULE_LICENSE("GPL");
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 7acd3febf8b0..de2254475d52 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -627,12 +627,18 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
627 u32 sscr0; 627 u32 sscr0;
628 u32 sspsp; 628 u32 sspsp;
629 int width = snd_pcm_format_physical_width(params_format(params)); 629 int width = snd_pcm_format_physical_width(params_format(params));
630 int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf;
630 631
631 /* select correct DMA params */ 632 /* select correct DMA params */
632 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 633 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
633 dma = 1; /* capture DMA offset is 1,3 */ 634 dma = 1; /* capture DMA offset is 1,3 */
634 if (chn == 2) 635 /* Network mode with one active slot (ttsa == 1) can be used
635 dma += 2; /* stereo DMA offset is 2, mono is 0 */ 636 * to force 16-bit frame width on the wire (for S16_LE), even
637 * with two channels. Use 16-bit DMA transfers for this case.
638 */
639 if (((chn == 2) && (ttsa != 1)) || (width == 32))
640 dma += 2; /* 32-bit DMA offset is 2, 16-bit is 0 */
641
636 cpu_dai->dma_data = ssp_dma_params[cpu_dai->id][dma]; 642 cpu_dai->dma_data = ssp_dma_params[cpu_dai->id][dma];
637 643
638 dev_dbg(&ssp->pdev->dev, "pxa_ssp_hw_params: dma %d\n", dma); 644 dev_dbg(&ssp->pdev->dev, "pxa_ssp_hw_params: dma %d\n", dma);
@@ -712,7 +718,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
712 /* When we use a network mode, we always require TDM slots 718 /* When we use a network mode, we always require TDM slots
713 * - complain loudly and fail if they've not been set up yet. 719 * - complain loudly and fail if they've not been set up yet.
714 */ 720 */
715 if ((sscr0 & SSCR0_MOD) && !(ssp_read_reg(ssp, SSTSA) & 0xf)) { 721 if ((sscr0 & SSCR0_MOD) && !ttsa) {
716 dev_err(&ssp->pdev->dev, "No TDM timeslot configured\n"); 722 dev_err(&ssp->pdev->dev, "No TDM timeslot configured\n");
717 return -EINVAL; 723 return -EINVAL;
718 } 724 }
@@ -800,6 +806,7 @@ static int pxa_ssp_probe(struct platform_device *pdev,
800 goto err_priv; 806 goto err_priv;
801 } 807 }
802 808
809 priv->dai_fmt = (unsigned int) -1;
803 dai->private_data = priv; 810 dai->private_data = priv;
804 811
805 return 0; 812 return 0;
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index 53b9fb127a6d..d38e39575f51 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -81,7 +81,7 @@ static struct snd_pcm_ops pxa2xx_pcm_ops = {
81 .mmap = pxa2xx_pcm_mmap, 81 .mmap = pxa2xx_pcm_mmap,
82}; 82};
83 83
84static u64 pxa2xx_pcm_dmamask = DMA_32BIT_MASK; 84static u64 pxa2xx_pcm_dmamask = DMA_BIT_MASK(32);
85 85
86static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, 86static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
87 struct snd_pcm *pcm) 87 struct snd_pcm *pcm)
@@ -91,7 +91,7 @@ static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
91 if (!card->dev->dma_mask) 91 if (!card->dev->dma_mask)
92 card->dev->dma_mask = &pxa2xx_pcm_dmamask; 92 card->dev->dma_mask = &pxa2xx_pcm_dmamask;
93 if (!card->dev->coherent_dma_mask) 93 if (!card->dev->coherent_dma_mask)
94 card->dev->coherent_dma_mask = DMA_32BIT_MASK; 94 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
95 95
96 if (dai->playback.channels_min) { 96 if (dai->playback.channels_min) {
97 ret = pxa2xx_pcm_preallocate_dma_buffer(pcm, 97 ret = pxa2xx_pcm_preallocate_dma_buffer(pcm,
diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig
index 2f3a21eee051..df494d1e346f 100644
--- a/sound/soc/s3c24xx/Kconfig
+++ b/sound/soc/s3c24xx/Kconfig
@@ -1,10 +1,10 @@
1config SND_S3C24XX_SOC 1config SND_S3C24XX_SOC
2 tristate "SoC Audio for the Samsung S3CXXXX chips" 2 tristate "SoC Audio for the Samsung S3CXXXX chips"
3 depends on ARCH_S3C2410 || ARCH_S3C64XX 3 depends on ARCH_S3C2410
4 help 4 help
5 Say Y or M if you want to add support for codecs attached to 5 Say Y or M if you want to add support for codecs attached to
6 the S3C24XX and S3C64XX AC97, I2S or SSP interface. You will 6 the S3C24XX AC97 or I2S interfaces. You will also need to
7 also need to select the audio interfaces to support below. 7 select the audio interfaces to support below.
8 8
9config SND_S3C24XX_SOC_I2S 9config SND_S3C24XX_SOC_I2S
10 tristate 10 tristate
diff --git a/sound/soc/s3c24xx/jive_wm8750.c b/sound/soc/s3c24xx/jive_wm8750.c
index 32063790d95b..93e6c87b7399 100644
--- a/sound/soc/s3c24xx/jive_wm8750.c
+++ b/sound/soc/s3c24xx/jive_wm8750.c
@@ -69,8 +69,8 @@ static int jive_hw_params(struct snd_pcm_substream *substream,
69 break; 69 break;
70 } 70 }
71 71
72 s3c_i2sv2_calc_rate(&div, NULL, params_rate(params), 72 s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params),
73 s3c2412_get_iisclk()); 73 s3c2412_get_iisclk());
74 74
75 /* set codec DAI configuration */ 75 /* set codec DAI configuration */
76 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | 76 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
@@ -145,8 +145,9 @@ static struct snd_soc_dai_link jive_dai = {
145}; 145};
146 146
147/* jive audio machine driver */ 147/* jive audio machine driver */
148static struct snd_soc_machine snd_soc_machine_jive = { 148static struct snd_soc_card snd_soc_machine_jive = {
149 .name = "Jive", 149 .name = "Jive",
150 .platform = &s3c24xx_soc_platform,
150 .dai_link = &jive_dai, 151 .dai_link = &jive_dai,
151 .num_links = 1, 152 .num_links = 1,
152}; 153};
@@ -157,9 +158,8 @@ static struct wm8750_setup_data jive_wm8750_setup = {
157 158
158/* jive audio subsystem */ 159/* jive audio subsystem */
159static struct snd_soc_device jive_snd_devdata = { 160static struct snd_soc_device jive_snd_devdata = {
160 .machine = &snd_soc_machine_jive, 161 .card = &snd_soc_machine_jive,
161 .platform = &s3c24xx_soc_platform, 162 .codec_dev = &soc_codec_dev_wm8750,
162 .codec_dev = &soc_codec_dev_wm8750_spi,
163 .codec_data = &jive_wm8750_setup, 163 .codec_data = &jive_wm8750_setup,
164}; 164};
165 165
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index 295a4c910262..689ffcd17e1f 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -473,9 +473,9 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
473/* default table of all avaialable root fs divisors */ 473/* default table of all avaialable root fs divisors */
474static unsigned int iis_fs_tab[] = { 256, 512, 384, 768 }; 474static unsigned int iis_fs_tab[] = { 256, 512, 384, 768 };
475 475
476int s3c2412_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, 476int s3c_i2sv2_iis_calc_rate(struct s3c_i2sv2_rate_calc *info,
477 unsigned int *fstab, 477 unsigned int *fstab,
478 unsigned int rate, struct clk *clk) 478 unsigned int rate, struct clk *clk)
479{ 479{
480 unsigned long clkrate = clk_get_rate(clk); 480 unsigned long clkrate = clk_get_rate(clk);
481 unsigned int div; 481 unsigned int div;
@@ -531,7 +531,7 @@ int s3c2412_iis_calc_rate(struct s3c_i2sv2_rate_calc *info,
531 531
532 return 0; 532 return 0;
533} 533}
534EXPORT_SYMBOL_GPL(s3c2412_iis_calc_rate); 534EXPORT_SYMBOL_GPL(s3c_i2sv2_iis_calc_rate);
535 535
536int s3c_i2sv2_probe(struct platform_device *pdev, 536int s3c_i2sv2_probe(struct platform_device *pdev,
537 struct snd_soc_dai *dai, 537 struct snd_soc_dai *dai,
@@ -624,10 +624,12 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
624 624
625int s3c_i2sv2_register_dai(struct snd_soc_dai *dai) 625int s3c_i2sv2_register_dai(struct snd_soc_dai *dai)
626{ 626{
627 dai->ops.trigger = s3c2412_i2s_trigger; 627 struct snd_soc_dai_ops *ops = dai->ops;
628 dai->ops.hw_params = s3c2412_i2s_hw_params; 628
629 dai->ops.set_fmt = s3c2412_i2s_set_fmt; 629 ops->trigger = s3c2412_i2s_trigger;
630 dai->ops.set_clkdiv = s3c2412_i2s_set_clkdiv; 630 ops->hw_params = s3c2412_i2s_hw_params;
631 ops->set_fmt = s3c2412_i2s_set_fmt;
632 ops->set_clkdiv = s3c2412_i2s_set_clkdiv;
631 633
632 dai->suspend = s3c2412_i2s_suspend; 634 dai->suspend = s3c2412_i2s_suspend;
633 dai->resume = s3c2412_i2s_resume; 635 dai->resume = s3c2412_i2s_resume;
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c
index 1ca3cdaa8213..b7e0b3f0bfc8 100644
--- a/sound/soc/s3c24xx/s3c2412-i2s.c
+++ b/sound/soc/s3c24xx/s3c2412-i2s.c
@@ -33,8 +33,8 @@
33 33
34#include <plat/regs-s3c2412-iis.h> 34#include <plat/regs-s3c2412-iis.h>
35 35
36#include <plat/regs-gpio.h>
37#include <plat/audio.h> 36#include <plat/audio.h>
37#include <mach/regs-gpio.h>
38#include <mach/dma.h> 38#include <mach/dma.h>
39 39
40#include "s3c24xx-pcm.h" 40#include "s3c24xx-pcm.h"
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index a9d68fa2b34a..169ddad31575 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -419,7 +419,7 @@ static void s3c24xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
419 } 419 }
420} 420}
421 421
422static u64 s3c24xx_pcm_dmamask = DMA_32BIT_MASK; 422static u64 s3c24xx_pcm_dmamask = DMA_BIT_MASK(32);
423 423
424static int s3c24xx_pcm_new(struct snd_card *card, 424static int s3c24xx_pcm_new(struct snd_card *card,
425 struct snd_soc_dai *dai, struct snd_pcm *pcm) 425 struct snd_soc_dai *dai, struct snd_pcm *pcm)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6e710f705a74..99712f652d0d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -98,7 +98,7 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
98 int err; 98 int err;
99 99
100 codec->ac97->dev.bus = &ac97_bus_type; 100 codec->ac97->dev.bus = &ac97_bus_type;
101 codec->ac97->dev.parent = NULL; 101 codec->ac97->dev.parent = codec->card->dev;
102 codec->ac97->dev.release = soc_ac97_device_release; 102 codec->ac97->dev.release = soc_ac97_device_release;
103 103
104 dev_set_name(&codec->ac97->dev, "%d-%d:%s", 104 dev_set_name(&codec->ac97->dev, "%d-%d:%s",
@@ -767,11 +767,21 @@ static int soc_resume(struct platform_device *pdev)
767{ 767{
768 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 768 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
769 struct snd_soc_card *card = socdev->card; 769 struct snd_soc_card *card = socdev->card;
770 struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai;
770 771
771 dev_dbg(socdev->dev, "scheduling resume work\n"); 772 /* AC97 devices might have other drivers hanging off them so
772 773 * need to resume immediately. Other drivers don't have that
773 if (!schedule_work(&card->deferred_resume_work)) 774 * problem and may take a substantial amount of time to resume
774 dev_err(socdev->dev, "resume work item may be lost\n"); 775 * due to I/O costs and anti-pop so handle them out of line.
776 */
777 if (cpu_dai->ac97_control) {
778 dev_dbg(socdev->dev, "Resuming AC97 immediately\n");
779 soc_resume_deferred(&card->deferred_resume_work);
780 } else {
781 dev_dbg(socdev->dev, "Scheduling resume work\n");
782 if (!schedule_work(&card->deferred_resume_work))
783 dev_err(socdev->dev, "resume work item may be lost\n");
784 }
775 785
776 return 0; 786 return 0;
777} 787}
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index 7d93fa705ccf..8d13d933087d 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -703,7 +703,7 @@ static int snd_cs4231_timer_stop(struct snd_timer *timer)
703 return 0; 703 return 0;
704} 704}
705 705
706static void __init snd_cs4231_init(struct snd_cs4231 *chip) 706static void __devinit snd_cs4231_init(struct snd_cs4231 *chip)
707{ 707{
708 unsigned long flags; 708 unsigned long flags;
709 709
@@ -1020,7 +1020,7 @@ static snd_pcm_uframes_t snd_cs4231_capture_pointer(
1020 return bytes_to_frames(substream->runtime, ptr); 1020 return bytes_to_frames(substream->runtime, ptr);
1021} 1021}
1022 1022
1023static int __init snd_cs4231_probe(struct snd_cs4231 *chip) 1023static int __devinit snd_cs4231_probe(struct snd_cs4231 *chip)
1024{ 1024{
1025 unsigned long flags; 1025 unsigned long flags;
1026 int i; 1026 int i;
@@ -1219,7 +1219,7 @@ static struct snd_pcm_ops snd_cs4231_capture_ops = {
1219 .pointer = snd_cs4231_capture_pointer, 1219 .pointer = snd_cs4231_capture_pointer,
1220}; 1220};
1221 1221
1222static int __init snd_cs4231_pcm(struct snd_card *card) 1222static int __devinit snd_cs4231_pcm(struct snd_card *card)
1223{ 1223{
1224 struct snd_cs4231 *chip = card->private_data; 1224 struct snd_cs4231 *chip = card->private_data;
1225 struct snd_pcm *pcm; 1225 struct snd_pcm *pcm;
@@ -1248,7 +1248,7 @@ static int __init snd_cs4231_pcm(struct snd_card *card)
1248 return 0; 1248 return 0;
1249} 1249}
1250 1250
1251static int __init snd_cs4231_timer(struct snd_card *card) 1251static int __devinit snd_cs4231_timer(struct snd_card *card)
1252{ 1252{
1253 struct snd_cs4231 *chip = card->private_data; 1253 struct snd_cs4231 *chip = card->private_data;
1254 struct snd_timer *timer; 1254 struct snd_timer *timer;
@@ -1499,7 +1499,7 @@ static int snd_cs4231_put_double(struct snd_kcontrol *kcontrol,
1499 .private_value = (left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | \ 1499 .private_value = (left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | \
1500 ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22) } 1500 ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22) }
1501 1501
1502static struct snd_kcontrol_new snd_cs4231_controls[] __initdata = { 1502static struct snd_kcontrol_new snd_cs4231_controls[] __devinitdata = {
1503CS4231_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, 1503CS4231_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT,
1504 CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), 1504 CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
1505CS4231_DOUBLE("PCM Playback Volume", 0, CS4231_LEFT_OUTPUT, 1505CS4231_DOUBLE("PCM Playback Volume", 0, CS4231_LEFT_OUTPUT,
@@ -1538,7 +1538,7 @@ CS4231_SINGLE("Line Out Switch", 0, CS4231_PIN_CTRL, 6, 1, 1),
1538CS4231_SINGLE("Headphone Out Switch", 0, CS4231_PIN_CTRL, 7, 1, 1) 1538CS4231_SINGLE("Headphone Out Switch", 0, CS4231_PIN_CTRL, 7, 1, 1)
1539}; 1539};
1540 1540
1541static int __init snd_cs4231_mixer(struct snd_card *card) 1541static int __devinit snd_cs4231_mixer(struct snd_card *card)
1542{ 1542{
1543 struct snd_cs4231 *chip = card->private_data; 1543 struct snd_cs4231 *chip = card->private_data;
1544 int err, idx; 1544 int err, idx;
@@ -1559,7 +1559,7 @@ static int __init snd_cs4231_mixer(struct snd_card *card)
1559 1559
1560static int dev; 1560static int dev;
1561 1561
1562static int __init cs4231_attach_begin(struct snd_card **rcard) 1562static int __devinit cs4231_attach_begin(struct snd_card **rcard)
1563{ 1563{
1564 struct snd_card *card; 1564 struct snd_card *card;
1565 struct snd_cs4231 *chip; 1565 struct snd_cs4231 *chip;
@@ -1590,7 +1590,7 @@ static int __init cs4231_attach_begin(struct snd_card **rcard)
1590 return 0; 1590 return 0;
1591} 1591}
1592 1592
1593static int __init cs4231_attach_finish(struct snd_card *card) 1593static int __devinit cs4231_attach_finish(struct snd_card *card)
1594{ 1594{
1595 struct snd_cs4231 *chip = card->private_data; 1595 struct snd_cs4231 *chip = card->private_data;
1596 int err; 1596 int err;
@@ -1794,9 +1794,9 @@ static struct snd_device_ops snd_cs4231_sbus_dev_ops = {
1794 .dev_free = snd_cs4231_sbus_dev_free, 1794 .dev_free = snd_cs4231_sbus_dev_free,
1795}; 1795};
1796 1796
1797static int __init snd_cs4231_sbus_create(struct snd_card *card, 1797static int __devinit snd_cs4231_sbus_create(struct snd_card *card,
1798 struct of_device *op, 1798 struct of_device *op,
1799 int dev) 1799 int dev)
1800{ 1800{
1801 struct snd_cs4231 *chip = card->private_data; 1801 struct snd_cs4231 *chip = card->private_data;
1802 int err; 1802 int err;
@@ -1960,9 +1960,9 @@ static struct snd_device_ops snd_cs4231_ebus_dev_ops = {
1960 .dev_free = snd_cs4231_ebus_dev_free, 1960 .dev_free = snd_cs4231_ebus_dev_free,
1961}; 1961};
1962 1962
1963static int __init snd_cs4231_ebus_create(struct snd_card *card, 1963static int __devinit snd_cs4231_ebus_create(struct snd_card *card,
1964 struct of_device *op, 1964 struct of_device *op,
1965 int dev) 1965 int dev)
1966{ 1966{
1967 struct snd_cs4231 *chip = card->private_data; 1967 struct snd_cs4231 *chip = card->private_data;
1968 int err; 1968 int err;
diff --git a/sound/usb/caiaq/Makefile b/sound/usb/caiaq/Makefile
index 23dadd5a11cd..388999653aaa 100644
--- a/sound/usb/caiaq/Makefile
+++ b/sound/usb/caiaq/Makefile
@@ -1,4 +1,4 @@
1snd-usb-caiaq-y := caiaq-device.o caiaq-audio.o caiaq-midi.o caiaq-control.o 1snd-usb-caiaq-y := device.o audio.o midi.o control.o
2snd-usb-caiaq-$(CONFIG_SND_USB_CAIAQ_INPUT) += caiaq-input.o 2snd-usb-caiaq-$(CONFIG_SND_USB_CAIAQ_INPUT) += input.o
3 3
4obj-$(CONFIG_SND_USB_CAIAQ) += snd-usb-caiaq.o 4obj-$(CONFIG_SND_USB_CAIAQ) += snd-usb-caiaq.o
diff --git a/sound/usb/caiaq/caiaq-audio.c b/sound/usb/caiaq/audio.c
index 08d51e0c9fea..3f45c0fe61ab 100644
--- a/sound/usb/caiaq/caiaq-audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -16,20 +16,14 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/ 17*/
18 18
19#include <linux/spinlock.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/moduleparam.h>
22#include <linux/interrupt.h>
23#include <linux/usb.h> 21#include <linux/usb.h>
24#include <linux/spinlock.h>
25#include <sound/core.h> 22#include <sound/core.h>
26#include <sound/initval.h>
27#include <sound/pcm.h> 23#include <sound/pcm.h>
28#include <sound/rawmidi.h>
29#include <linux/input.h>
30 24
31#include "caiaq-device.h" 25#include "device.h"
32#include "caiaq-audio.h" 26#include "audio.h"
33 27
34#define N_URBS 32 28#define N_URBS 32
35#define CLOCK_DRIFT_TOLERANCE 5 29#define CLOCK_DRIFT_TOLERANCE 5
diff --git a/sound/usb/caiaq/caiaq-audio.h b/sound/usb/caiaq/audio.h
index 8ab1f8d9529e..8ab1f8d9529e 100644
--- a/sound/usb/caiaq/caiaq-audio.h
+++ b/sound/usb/caiaq/audio.h
diff --git a/sound/usb/caiaq/caiaq-control.c b/sound/usb/caiaq/control.c
index e92c2bbf4fe9..537102ba6b9d 100644
--- a/sound/usb/caiaq/caiaq-control.c
+++ b/sound/usb/caiaq/control.c
@@ -18,17 +18,13 @@
18 */ 18 */
19 19
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/usb.h> 21#include <linux/usb.h>
22#include <sound/control.h>
23#include <sound/core.h> 23#include <sound/core.h>
24#include <sound/initval.h>
25#include <sound/pcm.h> 24#include <sound/pcm.h>
26#include <sound/rawmidi.h>
27#include <sound/control.h>
28#include <linux/input.h>
29 25
30#include "caiaq-device.h" 26#include "device.h"
31#include "caiaq-control.h" 27#include "control.h"
32 28
33#define CNT_INTVAL 0x10000 29#define CNT_INTVAL 0x10000
34 30
diff --git a/sound/usb/caiaq/caiaq-control.h b/sound/usb/caiaq/control.h
index 2e7ab1aa4fb3..2e7ab1aa4fb3 100644
--- a/sound/usb/caiaq/caiaq-control.h
+++ b/sound/usb/caiaq/control.h
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/device.c
index cf573a982fdc..6d517705da0e 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/device.c
@@ -19,27 +19,20 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20*/ 20*/
21 21
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/moduleparam.h> 22#include <linux/moduleparam.h>
25#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/module.h>
25#include <linux/init.h>
26#include <linux/usb.h> 26#include <linux/usb.h>
27#include <linux/input.h>
28#include <linux/spinlock.h>
29#include <sound/core.h>
30#include <sound/initval.h> 27#include <sound/initval.h>
28#include <sound/core.h>
31#include <sound/pcm.h> 29#include <sound/pcm.h>
32#include <sound/rawmidi.h>
33#include <sound/control.h>
34
35#include "caiaq-device.h"
36#include "caiaq-audio.h"
37#include "caiaq-midi.h"
38#include "caiaq-control.h"
39 30
40#ifdef CONFIG_SND_USB_CAIAQ_INPUT 31#include "device.h"
41#include "caiaq-input.h" 32#include "audio.h"
42#endif 33#include "midi.h"
34#include "control.h"
35#include "input.h"
43 36
44MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
45MODULE_DESCRIPTION("caiaq USB audio, version 1.3.13"); 38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.13");
diff --git a/sound/usb/caiaq/caiaq-device.h b/sound/usb/caiaq/device.h
index 4cce1ad7493d..4cce1ad7493d 100644
--- a/sound/usb/caiaq/caiaq-device.h
+++ b/sound/usb/caiaq/device.h
diff --git a/sound/usb/caiaq/caiaq-input.c b/sound/usb/caiaq/input.c
index f743847a5e5a..a48d309bd94c 100644
--- a/sound/usb/caiaq/caiaq-input.c
+++ b/sound/usb/caiaq/input.c
@@ -17,17 +17,12 @@
17*/ 17*/
18 18
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/moduleparam.h>
22#include <linux/input.h>
23#include <linux/usb.h> 20#include <linux/usb.h>
24#include <linux/usb/input.h> 21#include <linux/usb/input.h>
25#include <linux/spinlock.h>
26#include <sound/core.h>
27#include <sound/rawmidi.h>
28#include <sound/pcm.h> 22#include <sound/pcm.h>
29#include "caiaq-device.h" 23
30#include "caiaq-input.h" 24#include "device.h"
25#include "input.h"
31 26
32static unsigned short keycode_ak1[] = { KEY_C, KEY_B, KEY_A }; 27static unsigned short keycode_ak1[] = { KEY_C, KEY_B, KEY_A };
33static unsigned short keycode_rk2[] = { KEY_1, KEY_2, KEY_3, KEY_4, 28static unsigned short keycode_rk2[] = { KEY_1, KEY_2, KEY_3, KEY_4,
diff --git a/sound/usb/caiaq/caiaq-input.h b/sound/usb/caiaq/input.h
index ced535577864..ced535577864 100644
--- a/sound/usb/caiaq/caiaq-input.h
+++ b/sound/usb/caiaq/input.h
diff --git a/sound/usb/caiaq/caiaq-midi.c b/sound/usb/caiaq/midi.c
index f19fd360c936..8fa8cd88d763 100644
--- a/sound/usb/caiaq/caiaq-midi.c
+++ b/sound/usb/caiaq/midi.c
@@ -16,20 +16,13 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/ 17*/
18 18
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/moduleparam.h>
22#include <linux/interrupt.h>
23#include <linux/usb.h> 19#include <linux/usb.h>
24#include <linux/input.h>
25#include <linux/spinlock.h>
26#include <sound/core.h>
27#include <sound/rawmidi.h> 20#include <sound/rawmidi.h>
21#include <sound/core.h>
28#include <sound/pcm.h> 22#include <sound/pcm.h>
29 23
30#include "caiaq-device.h" 24#include "device.h"
31#include "caiaq-midi.h" 25#include "midi.h"
32
33 26
34static int snd_usb_caiaq_midi_input_open(struct snd_rawmidi_substream *substream) 27static int snd_usb_caiaq_midi_input_open(struct snd_rawmidi_substream *substream)
35{ 28{
diff --git a/sound/usb/caiaq/caiaq-midi.h b/sound/usb/caiaq/midi.h
index 9d16db027fc3..9d16db027fc3 100644
--- a/sound/usb/caiaq/caiaq-midi.h
+++ b/sound/usb/caiaq/midi.h
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c2db0f959681..823296d7d578 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -121,6 +121,7 @@ struct audioformat {
121 unsigned char attributes; /* corresponding attributes of cs endpoint */ 121 unsigned char attributes; /* corresponding attributes of cs endpoint */
122 unsigned char endpoint; /* endpoint */ 122 unsigned char endpoint; /* endpoint */
123 unsigned char ep_attr; /* endpoint attributes */ 123 unsigned char ep_attr; /* endpoint attributes */
124 unsigned char datainterval; /* log_2 of data packet interval */
124 unsigned int maxpacksize; /* max. packet size */ 125 unsigned int maxpacksize; /* max. packet size */
125 unsigned int rates; /* rate bitmasks */ 126 unsigned int rates; /* rate bitmasks */
126 unsigned int rate_min, rate_max; /* min/max rates */ 127 unsigned int rate_min, rate_max; /* min/max rates */
@@ -170,7 +171,6 @@ struct snd_usb_substream {
170 unsigned int curframesize; /* current packet size in frames (for capture) */ 171 unsigned int curframesize; /* current packet size in frames (for capture) */
171 unsigned int fill_max: 1; /* fill max packet size always */ 172 unsigned int fill_max: 1; /* fill max packet size always */
172 unsigned int fmt_type; /* USB audio format type (1-3) */ 173 unsigned int fmt_type; /* USB audio format type (1-3) */
173 unsigned int packs_per_ms; /* packets per millisecond (for playback) */
174 174
175 unsigned int running: 1; /* running status */ 175 unsigned int running: 1; /* running status */
176 176
@@ -607,9 +607,7 @@ static int prepare_playback_urb(struct snd_usb_substream *subs,
607 break; 607 break;
608 } 608 }
609 } 609 }
610 /* finish at the frame boundary at/after the period boundary */ 610 if (period_elapsed) /* finish at the period boundary */
611 if (period_elapsed &&
612 (i & (subs->packs_per_ms - 1)) == subs->packs_per_ms - 1)
613 break; 611 break;
614 } 612 }
615 if (subs->hwptr_done + offs > runtime->buffer_size) { 613 if (subs->hwptr_done + offs > runtime->buffer_size) {
@@ -1067,7 +1065,6 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
1067 packs_per_ms = 8 >> subs->datainterval; 1065 packs_per_ms = 8 >> subs->datainterval;
1068 else 1066 else
1069 packs_per_ms = 1; 1067 packs_per_ms = 1;
1070 subs->packs_per_ms = packs_per_ms;
1071 1068
1072 if (is_playback) { 1069 if (is_playback) {
1073 urb_packs = max(nrpacks, 1); 1070 urb_packs = max(nrpacks, 1);
@@ -1087,18 +1084,17 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
1087 minsize -= minsize >> 3; 1084 minsize -= minsize >> 3;
1088 minsize = max(minsize, 1u); 1085 minsize = max(minsize, 1u);
1089 total_packs = (period_bytes + minsize - 1) / minsize; 1086 total_packs = (period_bytes + minsize - 1) / minsize;
1090 /* round up to multiple of packs_per_ms */
1091 total_packs = (total_packs + packs_per_ms - 1)
1092 & ~(packs_per_ms - 1);
1093 /* we need at least two URBs for queueing */ 1087 /* we need at least two URBs for queueing */
1094 if (total_packs < 2 * packs_per_ms) { 1088 if (total_packs < 2) {
1095 total_packs = 2 * packs_per_ms; 1089 total_packs = 2;
1096 } else { 1090 } else {
1097 /* and we don't want too long a queue either */ 1091 /* and we don't want too long a queue either */
1098 maxpacks = max(MAX_QUEUE * packs_per_ms, urb_packs * 2); 1092 maxpacks = max(MAX_QUEUE * packs_per_ms, urb_packs * 2);
1099 total_packs = min(total_packs, maxpacks); 1093 total_packs = min(total_packs, maxpacks);
1100 } 1094 }
1101 } else { 1095 } else {
1096 while (urb_packs > 1 && urb_packs * maxsize >= period_bytes)
1097 urb_packs >>= 1;
1102 total_packs = MAX_URBS * urb_packs; 1098 total_packs = MAX_URBS * urb_packs;
1103 } 1099 }
1104 subs->nurbs = (total_packs + urb_packs - 1) / urb_packs; 1100 subs->nurbs = (total_packs + urb_packs - 1) / urb_packs;
@@ -1350,12 +1346,7 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
1350 subs->datapipe = usb_sndisocpipe(dev, ep); 1346 subs->datapipe = usb_sndisocpipe(dev, ep);
1351 else 1347 else
1352 subs->datapipe = usb_rcvisocpipe(dev, ep); 1348 subs->datapipe = usb_rcvisocpipe(dev, ep);
1353 if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH && 1349 subs->datainterval = fmt->datainterval;
1354 get_endpoint(alts, 0)->bInterval >= 1 &&
1355 get_endpoint(alts, 0)->bInterval <= 4)
1356 subs->datainterval = get_endpoint(alts, 0)->bInterval - 1;
1357 else
1358 subs->datainterval = 0;
1359 subs->syncpipe = subs->syncinterval = 0; 1350 subs->syncpipe = subs->syncinterval = 0;
1360 subs->maxpacksize = fmt->maxpacksize; 1351 subs->maxpacksize = fmt->maxpacksize;
1361 subs->fill_max = 0; 1352 subs->fill_max = 0;
@@ -1568,11 +1559,15 @@ static struct snd_pcm_hardware snd_usb_hardware =
1568#define hwc_debug(fmt, args...) /**/ 1559#define hwc_debug(fmt, args...) /**/
1569#endif 1560#endif
1570 1561
1571static int hw_check_valid_format(struct snd_pcm_hw_params *params, struct audioformat *fp) 1562static int hw_check_valid_format(struct snd_usb_substream *subs,
1563 struct snd_pcm_hw_params *params,
1564 struct audioformat *fp)
1572{ 1565{
1573 struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); 1566 struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
1574 struct snd_interval *ct = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 1567 struct snd_interval *ct = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
1575 struct snd_mask *fmts = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 1568 struct snd_mask *fmts = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
1569 struct snd_interval *pt = hw_param_interval(params, SNDRV_PCM_HW_PARAM_PERIOD_TIME);
1570 unsigned int ptime;
1576 1571
1577 /* check the format */ 1572 /* check the format */
1578 if (!snd_mask_test(fmts, fp->format)) { 1573 if (!snd_mask_test(fmts, fp->format)) {
@@ -1593,6 +1588,14 @@ static int hw_check_valid_format(struct snd_pcm_hw_params *params, struct audiof
1593 hwc_debug(" > check: rate_max %d < min %d\n", fp->rate_max, it->min); 1588 hwc_debug(" > check: rate_max %d < min %d\n", fp->rate_max, it->min);
1594 return 0; 1589 return 0;
1595 } 1590 }
1591 /* check whether the period time is >= the data packet interval */
1592 if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH) {
1593 ptime = 125 * (1 << fp->datainterval);
1594 if (ptime > pt->max || (ptime == pt->max && pt->openmax)) {
1595 hwc_debug(" > check: ptime %u > max %u\n", ptime, pt->max);
1596 return 0;
1597 }
1598 }
1596 return 1; 1599 return 1;
1597} 1600}
1598 1601
@@ -1611,7 +1614,7 @@ static int hw_rule_rate(struct snd_pcm_hw_params *params,
1611 list_for_each(p, &subs->fmt_list) { 1614 list_for_each(p, &subs->fmt_list) {
1612 struct audioformat *fp; 1615 struct audioformat *fp;
1613 fp = list_entry(p, struct audioformat, list); 1616 fp = list_entry(p, struct audioformat, list);
1614 if (!hw_check_valid_format(params, fp)) 1617 if (!hw_check_valid_format(subs, params, fp))
1615 continue; 1618 continue;
1616 if (changed++) { 1619 if (changed++) {
1617 if (rmin > fp->rate_min) 1620 if (rmin > fp->rate_min)
@@ -1665,7 +1668,7 @@ static int hw_rule_channels(struct snd_pcm_hw_params *params,
1665 list_for_each(p, &subs->fmt_list) { 1668 list_for_each(p, &subs->fmt_list) {
1666 struct audioformat *fp; 1669 struct audioformat *fp;
1667 fp = list_entry(p, struct audioformat, list); 1670 fp = list_entry(p, struct audioformat, list);
1668 if (!hw_check_valid_format(params, fp)) 1671 if (!hw_check_valid_format(subs, params, fp))
1669 continue; 1672 continue;
1670 if (changed++) { 1673 if (changed++) {
1671 if (rmin > fp->channels) 1674 if (rmin > fp->channels)
@@ -1718,7 +1721,7 @@ static int hw_rule_format(struct snd_pcm_hw_params *params,
1718 list_for_each(p, &subs->fmt_list) { 1721 list_for_each(p, &subs->fmt_list) {
1719 struct audioformat *fp; 1722 struct audioformat *fp;
1720 fp = list_entry(p, struct audioformat, list); 1723 fp = list_entry(p, struct audioformat, list);
1721 if (!hw_check_valid_format(params, fp)) 1724 if (!hw_check_valid_format(subs, params, fp))
1722 continue; 1725 continue;
1723 fbits |= (1ULL << fp->format); 1726 fbits |= (1ULL << fp->format);
1724 } 1727 }
@@ -1736,95 +1739,42 @@ static int hw_rule_format(struct snd_pcm_hw_params *params,
1736 return changed; 1739 return changed;
1737} 1740}
1738 1741
1739#define MAX_MASK 64 1742static int hw_rule_period_time(struct snd_pcm_hw_params *params,
1740 1743 struct snd_pcm_hw_rule *rule)
1741/*
1742 * check whether the registered audio formats need special hw-constraints
1743 */
1744static int check_hw_params_convention(struct snd_usb_substream *subs)
1745{ 1744{
1746 int i; 1745 struct snd_usb_substream *subs = rule->private;
1747 u32 *channels; 1746 struct audioformat *fp;
1748 u32 *rates; 1747 struct snd_interval *it;
1749 u32 cmaster, rmaster; 1748 unsigned char min_datainterval;
1750 u32 rate_min = 0, rate_max = 0; 1749 unsigned int pmin;
1751 struct list_head *p; 1750 int changed;
1752 int err = 1;
1753
1754 channels = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL);
1755 rates = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL);
1756 if (!channels || !rates) {
1757 err = -ENOMEM;
1758 goto __out;
1759 }
1760 1751
1761 list_for_each(p, &subs->fmt_list) { 1752 it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_PERIOD_TIME);
1762 struct audioformat *f; 1753 hwc_debug("hw_rule_period_time: (%u,%u)\n", it->min, it->max);
1763 f = list_entry(p, struct audioformat, list); 1754 min_datainterval = 0xff;
1764 /* unconventional channels? */ 1755 list_for_each_entry(fp, &subs->fmt_list, list) {
1765 if (f->channels > 32) 1756 if (!hw_check_valid_format(subs, params, fp))
1766 goto __out;
1767 /* continuous rate min/max matches? */
1768 if (f->rates & SNDRV_PCM_RATE_CONTINUOUS) {
1769 if (rate_min && f->rate_min != rate_min)
1770 goto __out;
1771 if (rate_max && f->rate_max != rate_max)
1772 goto __out;
1773 rate_min = f->rate_min;
1774 rate_max = f->rate_max;
1775 }
1776 /* combination of continuous rates and fixed rates? */
1777 if (rates[f->format] & SNDRV_PCM_RATE_CONTINUOUS) {
1778 if (f->rates != rates[f->format])
1779 goto __out;
1780 }
1781 if (f->rates & SNDRV_PCM_RATE_CONTINUOUS) {
1782 if (rates[f->format] && rates[f->format] != f->rates)
1783 goto __out;
1784 }
1785 channels[f->format] |= 1 << (f->channels - 1);
1786 rates[f->format] |= f->rates;
1787 /* needs knot? */
1788 if (f->rates & SNDRV_PCM_RATE_KNOT)
1789 goto __out;
1790 }
1791 /* check whether channels and rates match for all formats */
1792 cmaster = rmaster = 0;
1793 for (i = 0; i < MAX_MASK; i++) {
1794 if (cmaster != channels[i] && cmaster && channels[i])
1795 goto __out;
1796 if (rmaster != rates[i] && rmaster && rates[i])
1797 goto __out;
1798 if (channels[i])
1799 cmaster = channels[i];
1800 if (rates[i])
1801 rmaster = rates[i];
1802 }
1803 /* check whether channels match for all distinct rates */
1804 memset(channels, 0, MAX_MASK * sizeof(u32));
1805 list_for_each(p, &subs->fmt_list) {
1806 struct audioformat *f;
1807 f = list_entry(p, struct audioformat, list);
1808 if (f->rates & SNDRV_PCM_RATE_CONTINUOUS)
1809 continue; 1757 continue;
1810 for (i = 0; i < 32; i++) { 1758 min_datainterval = min(min_datainterval, fp->datainterval);
1811 if (f->rates & (1 << i))
1812 channels[i] |= 1 << (f->channels - 1);
1813 }
1814 } 1759 }
1815 cmaster = 0; 1760 if (min_datainterval == 0xff) {
1816 for (i = 0; i < 32; i++) { 1761 hwc_debug(" --> get emtpy\n");
1817 if (cmaster != channels[i] && cmaster && channels[i]) 1762 it->empty = 1;
1818 goto __out; 1763 return -EINVAL;
1819 if (channels[i])
1820 cmaster = channels[i];
1821 } 1764 }
1822 err = 0; 1765 pmin = 125 * (1 << min_datainterval);
1823 1766 changed = 0;
1824 __out: 1767 if (it->min < pmin) {
1825 kfree(channels); 1768 it->min = pmin;
1826 kfree(rates); 1769 it->openmin = 0;
1827 return err; 1770 changed = 1;
1771 }
1772 if (snd_interval_checkempty(it)) {
1773 it->empty = 1;
1774 return -EINVAL;
1775 }
1776 hwc_debug(" --> (%u,%u) (changed = %d)\n", it->min, it->max, changed);
1777 return changed;
1828} 1778}
1829 1779
1830/* 1780/*
@@ -1872,6 +1822,8 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
1872static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs) 1822static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs)
1873{ 1823{
1874 struct list_head *p; 1824 struct list_head *p;
1825 unsigned int pt, ptmin;
1826 int param_period_time_if_needed;
1875 int err; 1827 int err;
1876 1828
1877 runtime->hw.formats = subs->formats; 1829 runtime->hw.formats = subs->formats;
@@ -1881,6 +1833,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
1881 runtime->hw.channels_min = 256; 1833 runtime->hw.channels_min = 256;
1882 runtime->hw.channels_max = 0; 1834 runtime->hw.channels_max = 0;
1883 runtime->hw.rates = 0; 1835 runtime->hw.rates = 0;
1836 ptmin = UINT_MAX;
1884 /* check min/max rates and channels */ 1837 /* check min/max rates and channels */
1885 list_for_each(p, &subs->fmt_list) { 1838 list_for_each(p, &subs->fmt_list) {
1886 struct audioformat *fp; 1839 struct audioformat *fp;
@@ -1899,42 +1852,54 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
1899 runtime->hw.period_bytes_min = runtime->hw.period_bytes_max = 1852 runtime->hw.period_bytes_min = runtime->hw.period_bytes_max =
1900 fp->frame_size; 1853 fp->frame_size;
1901 } 1854 }
1855 pt = 125 * (1 << fp->datainterval);
1856 ptmin = min(ptmin, pt);
1902 } 1857 }
1903 1858
1904 /* set the period time minimum 1ms */ 1859 param_period_time_if_needed = SNDRV_PCM_HW_PARAM_PERIOD_TIME;
1905 /* FIXME: high-speed mode allows 125us minimum period, but many parts 1860 if (snd_usb_get_speed(subs->dev) != USB_SPEED_HIGH)
1906 * in the current code assume the 1ms period. 1861 /* full speed devices have fixed data packet interval */
1907 */ 1862 ptmin = 1000;
1863 if (ptmin == 1000)
1864 /* if period time doesn't go below 1 ms, no rules needed */
1865 param_period_time_if_needed = -1;
1908 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1866 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME,
1909 1000, 1867 ptmin, UINT_MAX);
1910 /*(nrpacks * MAX_URBS) * 1000*/ UINT_MAX); 1868
1911 1869 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
1912 err = check_hw_params_convention(subs); 1870 hw_rule_rate, subs,
1913 if (err < 0) 1871 SNDRV_PCM_HW_PARAM_FORMAT,
1872 SNDRV_PCM_HW_PARAM_CHANNELS,
1873 param_period_time_if_needed,
1874 -1)) < 0)
1914 return err; 1875 return err;
1915 else if (err) { 1876 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
1916 hwc_debug("setting extra hw constraints...\n"); 1877 hw_rule_channels, subs,
1917 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1878 SNDRV_PCM_HW_PARAM_FORMAT,
1918 hw_rule_rate, subs, 1879 SNDRV_PCM_HW_PARAM_RATE,
1919 SNDRV_PCM_HW_PARAM_FORMAT, 1880 param_period_time_if_needed,
1920 SNDRV_PCM_HW_PARAM_CHANNELS, 1881 -1)) < 0)
1921 -1)) < 0) 1882 return err;
1922 return err; 1883 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
1923 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 1884 hw_rule_format, subs,
1924 hw_rule_channels, subs, 1885 SNDRV_PCM_HW_PARAM_RATE,
1925 SNDRV_PCM_HW_PARAM_FORMAT, 1886 SNDRV_PCM_HW_PARAM_CHANNELS,
1926 SNDRV_PCM_HW_PARAM_RATE, 1887 param_period_time_if_needed,
1927 -1)) < 0) 1888 -1)) < 0)
1928 return err; 1889 return err;
1929 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, 1890 if (param_period_time_if_needed >= 0) {
1930 hw_rule_format, subs, 1891 err = snd_pcm_hw_rule_add(runtime, 0,
1931 SNDRV_PCM_HW_PARAM_RATE, 1892 SNDRV_PCM_HW_PARAM_PERIOD_TIME,
1932 SNDRV_PCM_HW_PARAM_CHANNELS, 1893 hw_rule_period_time, subs,
1933 -1)) < 0) 1894 SNDRV_PCM_HW_PARAM_FORMAT,
1934 return err; 1895 SNDRV_PCM_HW_PARAM_CHANNELS,
1935 if ((err = snd_usb_pcm_check_knot(runtime, subs)) < 0) 1896 SNDRV_PCM_HW_PARAM_RATE,
1897 -1);
1898 if (err < 0)
1936 return err; 1899 return err;
1937 } 1900 }
1901 if ((err = snd_usb_pcm_check_knot(runtime, subs)) < 0)
1902 return err;
1938 return 0; 1903 return 0;
1939} 1904}
1940 1905
@@ -2147,7 +2112,8 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s
2147 fp = list_entry(p, struct audioformat, list); 2112 fp = list_entry(p, struct audioformat, list);
2148 snd_iprintf(buffer, " Interface %d\n", fp->iface); 2113 snd_iprintf(buffer, " Interface %d\n", fp->iface);
2149 snd_iprintf(buffer, " Altset %d\n", fp->altsetting); 2114 snd_iprintf(buffer, " Altset %d\n", fp->altsetting);
2150 snd_iprintf(buffer, " Format: %#x\n", fp->format); 2115 snd_iprintf(buffer, " Format: %#x (%d bits)\n",
2116 fp->format, snd_pcm_format_width(fp->format));
2151 snd_iprintf(buffer, " Channels: %d\n", fp->channels); 2117 snd_iprintf(buffer, " Channels: %d\n", fp->channels);
2152 snd_iprintf(buffer, " Endpoint: %d %s (%s)\n", 2118 snd_iprintf(buffer, " Endpoint: %d %s (%s)\n",
2153 fp->endpoint & USB_ENDPOINT_NUMBER_MASK, 2119 fp->endpoint & USB_ENDPOINT_NUMBER_MASK,
@@ -2166,6 +2132,9 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s
2166 } 2132 }
2167 snd_iprintf(buffer, "\n"); 2133 snd_iprintf(buffer, "\n");
2168 } 2134 }
2135 if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH)
2136 snd_iprintf(buffer, " Data packet interval: %d us\n",
2137 125 * (1 << fp->datainterval));
2169 // snd_iprintf(buffer, " Max Packet Size = %d\n", fp->maxpacksize); 2138 // snd_iprintf(buffer, " Max Packet Size = %d\n", fp->maxpacksize);
2170 // snd_iprintf(buffer, " EP Attribute = %#x\n", fp->attributes); 2139 // snd_iprintf(buffer, " EP Attribute = %#x\n", fp->attributes);
2171 } 2140 }
@@ -2659,6 +2628,17 @@ static int parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp
2659 return 0; 2628 return 0;
2660} 2629}
2661 2630
2631static unsigned char parse_datainterval(struct snd_usb_audio *chip,
2632 struct usb_host_interface *alts)
2633{
2634 if (snd_usb_get_speed(chip->dev) == USB_SPEED_HIGH &&
2635 get_endpoint(alts, 0)->bInterval >= 1 &&
2636 get_endpoint(alts, 0)->bInterval <= 4)
2637 return get_endpoint(alts, 0)->bInterval - 1;
2638 else
2639 return 0;
2640}
2641
2662static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip, 2642static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip,
2663 int iface, int altno); 2643 int iface, int altno);
2664static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) 2644static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
@@ -2764,6 +2744,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
2764 fp->altset_idx = i; 2744 fp->altset_idx = i;
2765 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 2745 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
2766 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 2746 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
2747 fp->datainterval = parse_datainterval(chip, alts);
2767 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 2748 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
2768 if (snd_usb_get_speed(dev) == USB_SPEED_HIGH) 2749 if (snd_usb_get_speed(dev) == USB_SPEED_HIGH)
2769 fp->maxpacksize = (((fp->maxpacksize >> 11) & 3) + 1) 2750 fp->maxpacksize = (((fp->maxpacksize >> 11) & 3) + 1)
@@ -2955,6 +2936,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
2955 return -EINVAL; 2936 return -EINVAL;
2956 } 2937 }
2957 alts = &iface->altsetting[fp->altset_idx]; 2938 alts = &iface->altsetting[fp->altset_idx];
2939 fp->datainterval = parse_datainterval(chip, alts);
2958 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 2940 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
2959 usb_set_interface(chip->dev, fp->iface, 0); 2941 usb_set_interface(chip->dev, fp->iface, 0);
2960 init_usb_pitch(chip->dev, fp->iface, alts, fp); 2942 init_usb_pitch(chip->dev, fp->iface, alts, fp);
@@ -3049,6 +3031,7 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip,
3049 fp->iface = altsd->bInterfaceNumber; 3031 fp->iface = altsd->bInterfaceNumber;
3050 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 3032 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
3051 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 3033 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
3034 fp->datainterval = 0;
3052 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 3035 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
3053 3036
3054 switch (fp->maxpacksize) { 3037 switch (fp->maxpacksize) {
@@ -3116,6 +3099,7 @@ static int create_ua1000_quirk(struct snd_usb_audio *chip,
3116 fp->iface = altsd->bInterfaceNumber; 3099 fp->iface = altsd->bInterfaceNumber;
3117 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 3100 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
3118 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 3101 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
3102 fp->datainterval = parse_datainterval(chip, alts);
3119 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 3103 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
3120 fp->rate_max = fp->rate_min = combine_triple(&alts->extra[8]); 3104 fp->rate_max = fp->rate_min = combine_triple(&alts->extra[8]);
3121 3105
@@ -3168,6 +3152,7 @@ static int create_ua101_quirk(struct snd_usb_audio *chip,
3168 fp->iface = altsd->bInterfaceNumber; 3152 fp->iface = altsd->bInterfaceNumber;
3169 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 3153 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
3170 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 3154 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
3155 fp->datainterval = parse_datainterval(chip, alts);
3171 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 3156 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
3172 fp->rate_max = fp->rate_min = combine_triple(&alts->extra[15]); 3157 fp->rate_max = fp->rate_min = combine_triple(&alts->extra[15]);
3173 3158
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index 98276aafefe6..012ff1f6f8af 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -349,14 +349,10 @@ static int usb_stream_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
349 if (cmd != SNDRV_USB_STREAM_IOCTL_SET_PARAMS) 349 if (cmd != SNDRV_USB_STREAM_IOCTL_SET_PARAMS)
350 return -ENOTTY; 350 return -ENOTTY;
351 351
352 cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); 352 cfg = memdup_user((void *)arg, sizeof(*cfg));
353 if (!cfg) 353 if (IS_ERR(cfg))
354 return -ENOMEM; 354 return PTR_ERR(cfg);
355 355
356 if (copy_from_user(cfg, (void *)arg, sizeof(*cfg))) {
357 err = -EFAULT;
358 goto free;
359 }
360 if (cfg->version != USB_STREAM_INTERFACE_VERSION) { 356 if (cfg->version != USB_STREAM_INTERFACE_VERSION) {
361 err = -ENXIO; 357 err = -ENXIO;
362 goto free; 358 goto free;
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index 4af8740db717..f3d8f71265dd 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -203,13 +203,12 @@ static int snd_usX2Y_hwdep_dsp_load(struct snd_hwdep *hw,
203 203
204 if (access_ok(VERIFY_READ, dsp->image, dsp->length)) { 204 if (access_ok(VERIFY_READ, dsp->image, dsp->length)) {
205 struct usb_device* dev = priv->chip.dev; 205 struct usb_device* dev = priv->chip.dev;
206 char *buf = kmalloc(dsp->length, GFP_KERNEL); 206 char *buf;
207 if (!buf) 207
208 return -ENOMEM; 208 buf = memdup_user(dsp->image, dsp->length);
209 if (copy_from_user(buf, dsp->image, dsp->length)) { 209 if (IS_ERR(buf))
210 kfree(buf); 210 return PTR_ERR(buf);
211 return -EFAULT; 211
212 }
213 err = usb_set_interface(dev, 0, 1); 212 err = usb_set_interface(dev, 0, 1);
214 if (err) 213 if (err)
215 snd_printk(KERN_ERR "usb_set_interface error \n"); 214 snd_printk(KERN_ERR "usb_set_interface error \n");