2 ===================================================================
3 RCS file: /usr/local/src/blackfin/rsync/uclinux533/uClinux-dist/linux-2.6.x/sound/blackfin/ad1836.c,v
4 retrieving revision 1.57
5 diff -u -p -r1.57 ad1836.c
6 --- ad1836.c 29 Aug 2006 09:36:12 -0000 1.57
7 +++ ad1836.c 8 Sep 2006 23:25:58 -0000
8 @@ -917,6 +917,7 @@ static int snd_ad1836_playback_close(snd
12 + snd_printk_marker();
13 chip->tx_substream = NULL;
16 @@ -946,11 +947,13 @@ static int snd_ad1836_hw_params(snd_pcm_
18 #ifdef CONFIG_SND_BLACKFIN_AD1836_TDM
20 -#ifdef MULTI_SUBSTREAM
21 +# ifdef MULTI_SUBSTREAM
22 substream_info_t *sub_info = NULL;
23 ad1836_t *chip = snd_pcm_substream_chip(substream);
24 int index = find_substream(chip, substream, &sub_info);
26 + snd_printk_marker();
28 if (chip->rx_substream == substream) {
29 substream->runtime->dma_area = chip->rx_dma_buf;
30 substream->runtime->dma_addr = (unsigned int)chip->rx_dma_buf;
31 @@ -961,18 +964,19 @@ static int snd_ad1836_hw_params(snd_pcm_
32 substream->runtime->dma_bytes = AD1836_BUF_SZ;
37 + snd_printk_marker();
38 if (snd_pcm_lib_malloc_pages(substream, AD1836_BUF_SZ) < 0)
44 + snd_printk_marker();
45 if (snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hwparams)) < 0)
53 static int snd_ad1836_hw_free(snd_pcm_substream_t * substream)
54 @@ -1080,6 +1084,8 @@ static int snd_ad1836_playback_trigger(s
55 snd_assert((index >= 0 && index <= 2 && sub_info), return -EINVAL);
58 + snd_printk_marker();
60 spin_lock(&chip->ad1836_lock);
62 case SNDRV_PCM_TRIGGER_START:
63 @@ -1121,6 +1127,8 @@ static int snd_ad1836_capture_trigger(sn
65 ad1836_t *chip = snd_pcm_substream_chip(substream);
67 + snd_printk_marker();
69 spin_lock(&chip->ad1836_lock);
70 snd_assert(substream == chip->rx_substream, return -EINVAL);
72 @@ -1158,6 +1166,8 @@ static snd_pcm_uframes_t snd_ad1836_play
74 size_t frames = diff / bytes_per_frame;
76 + snd_printk_marker();
78 #ifdef MULTI_SUBSTREAM
79 find_substream(chip, substream, &sub_info);
80 frames = (frames + DMA_BUFFER_FRAMES - sub_info->dma_offset) % \
81 @@ -1197,8 +1207,10 @@ static snd_pcm_uframes_t snd_ad1836_capt
83 size_t frames = diff / bytes_per_frame;
85 + snd_printk_marker();
87 #ifdef CONFIG_SND_DEBUG_CURRPTR
88 - snd_printk(KERN_INFO " capture pos: 0x%04x / %lx\n", frames,
89 + snd_printk(KERN_DEBUG "capture pos: 0x%04x / %lx\n", frames,
90 runtime->buffer_size);
93 @@ -1399,7 +1411,7 @@ static int snd_ad1836_playback_silence(s
94 frames_to_bytes(substream->runtime, count));
96 #ifdef CONFIG_SND_DEBUG_CURRPTR
97 - snd_printk(KERN_INFO "silence: pos %x, count %x\n", (uint)pos, (uint)count);
98 + snd_printk(KERN_DEBUG "silence: pos %x, count %x\n", (uint)pos, (uint)count);
102 @@ -1411,7 +1423,7 @@ static int snd_ad1836_capture_silence(sn
103 unsigned char *buf = substream->runtime->dma_area;
105 #ifdef CONFIG_SND_DEBUG
106 - snd_printk(KERN_INFO "silence: pos %x, count %x\n",
107 + snd_printk(KERN_DEBUG "silence: pos %x, count %x\n",
108 (uint)pos, (uint)count);
110 #ifdef CONFIG_SND_BLACKFIN_AD1836_TDM
111 @@ -1457,6 +1469,8 @@ static snd_pcm_ops_t snd_ad1836_capture_
112 *************************************************************/
113 static int snd_ad1836_stop(struct snd_ad1836 *chip)
115 + snd_printk_marker();
117 snd_ad1836_set_register(chip, DAC_CTRL_2, DAC_MUTE_MASK, DAC_MUTE_MASK);
118 snd_ad1836_set_register(chip, ADC_CTRL_2, ADC_MUTE_MASK, ADC_MUTE_MASK);
119 snd_ad1836_set_register(chip, DAC_CTRL_1, DAC_PWRDWN, DAC_PWRDWN);
120 @@ -1469,6 +1483,8 @@ static int snd_ad1836_dev_free(snd_devic
122 struct snd_ad1836 *chip = (ad1836_t *)device->device_data;
124 + snd_printk_marker();
126 #ifdef MULTI_SUBSTREAM
127 dma_free_coherent(NULL, AD1836_BUF_SZ, chip->rx_dma_buf, 0);
128 dma_free_coherent(NULL, AD1836_BUF_SZ, chip->tx_dma_buf, 0);
129 @@ -1514,7 +1530,7 @@ static int snd_bf53x_ad1836_reset(ad1836
131 bfin_write(FlashA_PortA_Dir,0x1); /* configure flag as an output pin */
133 - snd_printk(KERN_INFO "resetting ezkit 1836 using flash flag pin\n");
134 + snd_printk(KERN_INFO "resetting ezkit using flash flag pin\n");
135 bfin_write(FlashA_PortA_Data,0x0); /* reset is active low */
136 udelay(1); /* hold low */
138 @@ -1532,6 +1548,8 @@ static int snd_ad1836_configure(ad1836_t
140 struct bf53x_sport *sport= chip->sport;
142 + snd_printk_marker();
144 snd_bf53x_ad1836_reset(chip);
146 /* see if we are connected by writing (preferably something useful)
147 @@ -1592,6 +1610,8 @@ static int snd_ad1836_configure(ad1836_t
149 struct bf53x_sport *sport= chip->sport;
151 + snd_printk_marker();
153 snd_bf53x_ad1836_reset(chip);
155 /* Power up DAC and ADC */
156 @@ -1672,7 +1692,7 @@ static void snd_ad1836_dma_tx(void *data
158 static void snd_ad1836_sport_err(void *data)
160 - printk(KERN_ERR "%s: err happened on sport\n", __FUNCTION__);
161 + printk(KERN_ERR DRIVER_NAME ":%s: err happened on sport\n", __FUNCTION__);
164 static void snd_ad1836_proc_registers_read(snd_info_entry_t * entry,
165 @@ -1742,6 +1762,8 @@ static int __devinit snd_ad1836_pcm(stru
169 + snd_printk_marker();
171 #ifdef MULTI_SUBSTREAM
172 /* 3 playback and 1 capture substream, 2 channels each */
173 err = snd_pcm_new(ad1836->card, PCM_NAME, 0, 3, 1, &pcm);
174 @@ -1779,12 +1801,16 @@ static int __devinit snd_ad1836_probe(st
178 + snd_printk_marker();
183 card = snd_card_new(-1, NULL, THIS_MODULE, sizeof(struct snd_ad1836));
185 + if (card == NULL) {
186 + snd_printdd(KERN_DEBUG "%s: snd_card_new() failed\n", __FUNCTION__);
190 ad1836 = card->private_data;
192 @@ -1810,7 +1836,7 @@ static int __devinit snd_ad1836_probe(st
193 ad1836->rx_dma_buf = dma_alloc_coherent(NULL, AD1836_BUF_SZ, &addr, 0);
194 ad1836->tx_dma_buf = dma_alloc_coherent(NULL, AD1836_BUF_SZ, &addr, 0);
195 if (!ad1836->rx_dma_buf || !ad1836->tx_dma_buf) {
196 - printk(KERN_ERR"Failed to allocate DMA buffer\n");
197 + printk(KERN_ERR DRIVER_NAME ": Failed to allocate DMA buffer\n");
201 @@ -1820,6 +1846,7 @@ static int __devinit snd_ad1836_probe(st
202 SPORT_DMA_TX, snd_ad1836_dma_tx,
203 SPORT_IRQ_ERR, snd_ad1836_sport_err, ad1836))
205 + printk(KERN_ERR DRIVER_NAME ": Failed to find device on sport\n");
209 @@ -1891,6 +1918,8 @@ static int snd_ad1836_suspend(struct pla
210 struct snd_card *card = platform_get_drvdata(pdev);
211 struct snd_ad1836 *ad1836 = card->private_data;
213 + snd_printk_marker();
215 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
216 snd_pcm_suspend_all(ad1836->pcm);
218 @@ -1900,6 +1929,8 @@ static int snd_ad1836_resume(struct plat
220 struct snd_card *card = platform_get_drvdata(pdev);
222 + snd_printk_marker();
224 snd_power_change_state(card, SNDRV_CTL_POWER_D0);