| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Support for audio capture |
| 4 | * PCI function #1 of the cx2388x. |
| 5 | * |
| 6 | * (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org> |
| Mauro Carvalho Chehab | 2e7c6dc | 2006-04-03 07:53:40 -0300 | [diff] [blame] | 7 | * (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 8 | * Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org> |
| 9 | * Based on dummy.c by Jaroslav Kysela <perex@suse.cz> |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software |
| 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 24 | */ |
| 25 | |
| 26 | #include <linux/module.h> |
| 27 | #include <linux/init.h> |
| 28 | #include <linux/device.h> |
| 29 | #include <linux/interrupt.h> |
| Andrew Morton | c24228d | 2007-05-06 14:51:55 -0700 | [diff] [blame] | 30 | #include <linux/dma-mapping.h> |
| 31 | |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 32 | #include <asm/delay.h> |
| 33 | #include <sound/driver.h> |
| 34 | #include <sound/core.h> |
| 35 | #include <sound/pcm.h> |
| 36 | #include <sound/pcm_params.h> |
| 37 | #include <sound/control.h> |
| 38 | #include <sound/initval.h> |
| 39 | |
| 40 | #include "cx88.h" |
| 41 | #include "cx88-reg.h" |
| 42 | |
| 43 | #define dprintk(level,fmt, arg...) if (debug >= level) \ |
| 44 | printk(KERN_INFO "%s/1: " fmt, chip->core->name , ## arg) |
| 45 | |
| 46 | #define dprintk_core(level,fmt, arg...) if (debug >= level) \ |
| 47 | printk(KERN_DEBUG "%s/1: " fmt, chip->core->name , ## arg) |
| 48 | |
| 49 | |
| 50 | /**************************************************************************** |
| 51 | Data type declarations - Can be moded to a header file later |
| 52 | ****************************************************************************/ |
| 53 | |
| 54 | /* These can be replaced after done */ |
| 55 | #define MIXER_ADDR_LAST MAX_CX88_INPUT |
| 56 | |
| 57 | struct cx88_audio_dev { |
| 58 | struct cx88_core *core; |
| 59 | struct cx88_dmaqueue q; |
| 60 | |
| 61 | /* pci i/o */ |
| 62 | struct pci_dev *pci; |
| 63 | unsigned char pci_rev,pci_lat; |
| 64 | |
| 65 | /* audio controls */ |
| 66 | int irq; |
| 67 | |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 68 | struct snd_card *card; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 69 | |
| 70 | spinlock_t reg_lock; |
| 71 | |
| 72 | unsigned int dma_size; |
| 73 | unsigned int period_size; |
| 74 | unsigned int num_periods; |
| 75 | |
| 76 | struct videobuf_dmabuf dma_risc; |
| 77 | |
| 78 | int mixer_volume[MIXER_ADDR_LAST+1][2]; |
| 79 | int capture_source[MIXER_ADDR_LAST+1][2]; |
| 80 | |
| 81 | long int read_count; |
| 82 | long int read_offset; |
| 83 | |
| 84 | struct cx88_buffer *buf; |
| 85 | |
| 86 | long opened; |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 87 | struct snd_pcm_substream *substream; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 88 | |
| 89 | }; |
| 90 | typedef struct cx88_audio_dev snd_cx88_card_t; |
| 91 | |
| 92 | |
| 93 | |
| 94 | /**************************************************************************** |
| 95 | Module global static vars |
| 96 | ****************************************************************************/ |
| 97 | |
| 98 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 99 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| 100 | static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1}; |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 101 | static struct snd_card *snd_cx88_cards[SNDRV_CARDS]; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 102 | |
| 103 | module_param_array(enable, bool, NULL, 0444); |
| 104 | MODULE_PARM_DESC(enable, "Enable cx88x soundcard. default enabled."); |
| 105 | |
| 106 | module_param_array(index, int, NULL, 0444); |
| 107 | MODULE_PARM_DESC(index, "Index value for cx88x capture interface(s)."); |
| 108 | |
| 109 | |
| 110 | /**************************************************************************** |
| 111 | Module macros |
| 112 | ****************************************************************************/ |
| 113 | |
| 114 | MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards"); |
| 115 | MODULE_AUTHOR("Ricardo Cerqueira"); |
| Mauro Carvalho Chehab | 2e7c6dc | 2006-04-03 07:53:40 -0300 | [diff] [blame] | 116 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 117 | MODULE_LICENSE("GPL"); |
| 118 | MODULE_SUPPORTED_DEVICE("{{Conexant,23881}," |
| 119 | "{{Conexant,23882}," |
| 120 | "{{Conexant,23883}"); |
| Mauro Carvalho Chehab | a5ed425 | 2006-01-13 14:10:19 -0200 | [diff] [blame] | 121 | static unsigned int debug; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 122 | module_param(debug,int,0644); |
| 123 | MODULE_PARM_DESC(debug,"enable debug messages"); |
| 124 | |
| 125 | /**************************************************************************** |
| 126 | Module specific funtions |
| 127 | ****************************************************************************/ |
| 128 | |
| 129 | /* |
| 130 | * BOARD Specific: Sets audio DMA |
| 131 | */ |
| 132 | |
| Mauro Carvalho Chehab | be8a82d | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 133 | static int _cx88_start_audio_dma(snd_cx88_card_t *chip) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 134 | { |
| 135 | struct cx88_buffer *buf = chip->buf; |
| 136 | struct cx88_core *core=chip->core; |
| 137 | struct sram_channel *audio_ch = &cx88_sram_channels[SRAM_CH25]; |
| 138 | |
| 139 | |
| 140 | dprintk(1, "Starting audio DMA for %i bytes/line and %i (%i) lines at address %08x\n",buf->bpl, chip->num_periods, audio_ch->fifo_size / buf->bpl, audio_ch->fifo_start); |
| 141 | |
| 142 | /* setup fifo + format - out channel */ |
| 143 | cx88_sram_channel_setup(chip->core, &cx88_sram_channels[SRAM_CH25], |
| 144 | buf->bpl, buf->risc.dma); |
| 145 | |
| 146 | /* sets bpl size */ |
| 147 | cx_write(MO_AUDD_LNGTH, buf->bpl); |
| 148 | |
| 149 | /* reset counter */ |
| 150 | cx_write(MO_AUDD_GPCNTRL,GP_COUNT_CONTROL_RESET); |
| 151 | |
| Trent Piepho | 8ddac9e | 2007-08-18 06:57:55 -0300 | [diff] [blame] | 152 | dprintk(1, "Enabling IRQ, setting mask from 0x%x to 0x%x\n", |
| 153 | chip->core->pci_irqmask, |
| 154 | chip->core->pci_irqmask | PCI_INT_AUDINT); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 155 | /* enable irqs */ |
| Trent Piepho | 8ddac9e | 2007-08-18 06:57:55 -0300 | [diff] [blame] | 156 | cx_set(MO_PCI_INTMSK, chip->core->pci_irqmask | PCI_INT_AUDINT); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 157 | |
| 158 | |
| 159 | /* Enables corresponding bits at AUD_INT_STAT */ |
| 160 | cx_write(MO_AUD_INTMSK, |
| 161 | (1<<16)| |
| 162 | (1<<12)| |
| 163 | (1<<4)| |
| 164 | (1<<0) |
| 165 | ); |
| 166 | |
| 167 | /* start dma */ |
| 168 | cx_set(MO_DEV_CNTRL2, (1<<5)); /* Enables Risc Processor */ |
| 169 | cx_set(MO_AUD_DMACNTRL, 0x11); /* audio downstream FIFO and RISC enable */ |
| 170 | |
| 171 | if (debug) |
| 172 | cx88_sram_channel_dump(chip->core, &cx88_sram_channels[SRAM_CH25]); |
| 173 | |
| 174 | return 0; |
| 175 | } |
| 176 | |
| 177 | /* |
| 178 | * BOARD Specific: Resets audio DMA |
| 179 | */ |
| Mauro Carvalho Chehab | be8a82d | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 180 | static int _cx88_stop_audio_dma(snd_cx88_card_t *chip) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 181 | { |
| 182 | struct cx88_core *core=chip->core; |
| 183 | dprintk(1, "Stopping audio DMA\n"); |
| 184 | |
| 185 | /* stop dma */ |
| 186 | cx_clear(MO_AUD_DMACNTRL, 0x11); |
| 187 | |
| 188 | /* disable irqs */ |
| Trent Piepho | 8ddac9e | 2007-08-18 06:57:55 -0300 | [diff] [blame] | 189 | cx_clear(MO_PCI_INTMSK, PCI_INT_AUDINT); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 190 | cx_clear(MO_AUD_INTMSK, |
| 191 | (1<<16)| |
| 192 | (1<<12)| |
| 193 | (1<<4)| |
| 194 | (1<<0) |
| 195 | ); |
| 196 | |
| 197 | if (debug) |
| 198 | cx88_sram_channel_dump(chip->core, &cx88_sram_channels[SRAM_CH25]); |
| 199 | |
| 200 | return 0; |
| 201 | } |
| 202 | |
| 203 | #define MAX_IRQ_LOOP 10 |
| 204 | |
| 205 | /* |
| 206 | * BOARD Specific: IRQ dma bits |
| 207 | */ |
| 208 | static char *cx88_aud_irqs[32] = { |
| 209 | "dn_risci1", "up_risci1", "rds_dn_risc1", /* 0-2 */ |
| 210 | NULL, /* reserved */ |
| 211 | "dn_risci2", "up_risci2", "rds_dn_risc2", /* 4-6 */ |
| 212 | NULL, /* reserved */ |
| 213 | "dnf_of", "upf_uf", "rds_dnf_uf", /* 8-10 */ |
| 214 | NULL, /* reserved */ |
| 215 | "dn_sync", "up_sync", "rds_dn_sync", /* 12-14 */ |
| 216 | NULL, /* reserved */ |
| 217 | "opc_err", "par_err", "rip_err", /* 16-18 */ |
| 218 | "pci_abort", "ber_irq", "mchg_irq" /* 19-21 */ |
| 219 | }; |
| 220 | |
| 221 | /* |
| 222 | * BOARD Specific: Threats IRQ audio specific calls |
| 223 | */ |
| 224 | static void cx8801_aud_irq(snd_cx88_card_t *chip) |
| 225 | { |
| 226 | struct cx88_core *core = chip->core; |
| 227 | u32 status, mask; |
| 228 | u32 count; |
| 229 | |
| 230 | status = cx_read(MO_AUD_INTSTAT); |
| 231 | mask = cx_read(MO_AUD_INTMSK); |
| 232 | if (0 == (status & mask)) { |
| 233 | spin_unlock(&chip->reg_lock); |
| 234 | return; |
| 235 | } |
| 236 | cx_write(MO_AUD_INTSTAT, status); |
| 237 | if (debug > 1 || (status & mask & ~0xff)) |
| 238 | cx88_print_irqbits(core->name, "irq aud", |
| Mauro Carvalho Chehab | 66623a0 | 2007-03-29 08:47:04 -0300 | [diff] [blame] | 239 | cx88_aud_irqs, ARRAY_SIZE(cx88_aud_irqs), |
| 240 | status, mask); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 241 | /* risc op code error */ |
| 242 | if (status & (1 << 16)) { |
| 243 | printk(KERN_WARNING "%s/0: audio risc op code error\n",core->name); |
| 244 | cx_clear(MO_AUD_DMACNTRL, 0x11); |
| 245 | cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH25]); |
| 246 | } |
| 247 | |
| 248 | /* risc1 downstream */ |
| 249 | if (status & 0x01) { |
| 250 | spin_lock(&chip->reg_lock); |
| 251 | count = cx_read(MO_AUDD_GPCNT); |
| 252 | spin_unlock(&chip->reg_lock); |
| 253 | if (chip->read_count == 0) |
| 254 | chip->read_count += chip->dma_size; |
| 255 | } |
| 256 | |
| 257 | if (chip->read_count >= chip->period_size) { |
| 258 | dprintk(2, "Elapsing period\n"); |
| 259 | snd_pcm_period_elapsed(chip->substream); |
| 260 | } |
| 261 | |
| 262 | dprintk(3,"Leaving audio IRQ handler...\n"); |
| 263 | |
| 264 | /* FIXME: Any other status should deserve a special handling? */ |
| 265 | } |
| 266 | |
| 267 | /* |
| 268 | * BOARD Specific: Handles IRQ calls |
| 269 | */ |
| David Howells | 7d12e78 | 2006-10-05 14:55:46 +0100 | [diff] [blame] | 270 | static irqreturn_t cx8801_irq(int irq, void *dev_id) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 271 | { |
| 272 | snd_cx88_card_t *chip = dev_id; |
| 273 | struct cx88_core *core = chip->core; |
| 274 | u32 status; |
| 275 | int loop, handled = 0; |
| 276 | |
| 277 | for (loop = 0; loop < MAX_IRQ_LOOP; loop++) { |
| Trent Piepho | 8ddac9e | 2007-08-18 06:57:55 -0300 | [diff] [blame] | 278 | status = cx_read(MO_PCI_INTSTAT) & |
| 279 | (core->pci_irqmask | PCI_INT_AUDINT); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 280 | if (0 == status) |
| 281 | goto out; |
| 282 | dprintk( 3, "cx8801_irq\n" ); |
| 283 | dprintk( 3, " loop: %d/%d\n", loop, MAX_IRQ_LOOP ); |
| 284 | dprintk( 3, " status: %d\n", status ); |
| 285 | handled = 1; |
| 286 | cx_write(MO_PCI_INTSTAT, status); |
| 287 | |
| Trent Piepho | 5ba862b | 2007-08-18 07:02:26 -0300 | [diff] [blame^] | 288 | if (status & core->pci_irqmask) |
| 289 | cx88_core_irq(core, status); |
| Trent Piepho | 8ddac9e | 2007-08-18 06:57:55 -0300 | [diff] [blame] | 290 | if (status & PCI_INT_AUDINT) { |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 291 | dprintk( 2, " ALSA IRQ handling\n" ); |
| 292 | cx8801_aud_irq(chip); |
| 293 | } |
| 294 | }; |
| 295 | |
| 296 | if (MAX_IRQ_LOOP == loop) { |
| 297 | dprintk( 0, "clearing mask\n" ); |
| 298 | dprintk(1,"%s/0: irq loop -- clearing mask\n", |
| 299 | core->name); |
| Trent Piepho | 8ddac9e | 2007-08-18 06:57:55 -0300 | [diff] [blame] | 300 | cx_clear(MO_PCI_INTMSK, PCI_INT_AUDINT); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | out: |
| 304 | return IRQ_RETVAL(handled); |
| 305 | } |
| 306 | |
| 307 | |
| 308 | static int dsp_buffer_free(snd_cx88_card_t *chip) |
| 309 | { |
| 310 | BUG_ON(!chip->dma_size); |
| 311 | |
| 312 | dprintk(2,"Freeing buffer\n"); |
| Mauro Carvalho Chehab | c7b0ac0 | 2006-03-10 12:29:15 -0300 | [diff] [blame] | 313 | videobuf_pci_dma_unmap(chip->pci, &chip->dma_risc); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 314 | videobuf_dma_free(&chip->dma_risc); |
| 315 | btcx_riscmem_free(chip->pci,&chip->buf->risc); |
| 316 | kfree(chip->buf); |
| 317 | |
| 318 | chip->dma_size = 0; |
| 319 | |
| 320 | return 0; |
| 321 | } |
| 322 | |
| 323 | /**************************************************************************** |
| 324 | ALSA PCM Interface |
| 325 | ****************************************************************************/ |
| 326 | |
| 327 | /* |
| 328 | * Digital hardware definition |
| 329 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 330 | static struct snd_pcm_hardware snd_cx88_digital_hw = { |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 331 | .info = SNDRV_PCM_INFO_MMAP | |
| 332 | SNDRV_PCM_INFO_INTERLEAVED | |
| 333 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
| 334 | SNDRV_PCM_INFO_MMAP_VALID, |
| 335 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
| 336 | |
| 337 | .rates = SNDRV_PCM_RATE_48000, |
| 338 | .rate_min = 48000, |
| 339 | .rate_max = 48000, |
| 340 | .channels_min = 1, |
| 341 | .channels_max = 2, |
| 342 | .buffer_bytes_max = (2*2048), |
| Ricardo Cerqueira | 18adfe7 | 2006-01-15 15:33:02 -0200 | [diff] [blame] | 343 | .period_bytes_min = 2048, |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 344 | .period_bytes_max = 2048, |
| 345 | .periods_min = 2, |
| Ricardo Cerqueira | 18adfe7 | 2006-01-15 15:33:02 -0200 | [diff] [blame] | 346 | .periods_max = 2, |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 347 | }; |
| 348 | |
| 349 | /* |
| 350 | * audio pcm capture runtime free |
| 351 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 352 | static void snd_card_cx88_runtime_free(struct snd_pcm_runtime *runtime) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 353 | { |
| 354 | } |
| 355 | /* |
| 356 | * audio pcm capture open callback |
| 357 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 358 | static int snd_cx88_pcm_open(struct snd_pcm_substream *substream) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 359 | { |
| 360 | snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 361 | struct snd_pcm_runtime *runtime = substream->runtime; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 362 | int err; |
| 363 | |
| 364 | if (test_and_set_bit(0, &chip->opened)) |
| 365 | return -EBUSY; |
| 366 | |
| 367 | err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); |
| 368 | if (err < 0) |
| 369 | goto _error; |
| 370 | |
| 371 | chip->substream = substream; |
| 372 | |
| 373 | chip->read_count = 0; |
| 374 | chip->read_offset = 0; |
| 375 | |
| 376 | runtime->private_free = snd_card_cx88_runtime_free; |
| 377 | runtime->hw = snd_cx88_digital_hw; |
| 378 | |
| 379 | return 0; |
| 380 | _error: |
| 381 | dprintk(1,"Error opening PCM!\n"); |
| 382 | clear_bit(0, &chip->opened); |
| 383 | smp_mb__after_clear_bit(); |
| 384 | return err; |
| 385 | } |
| 386 | |
| 387 | /* |
| 388 | * audio close callback |
| 389 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 390 | static int snd_cx88_close(struct snd_pcm_substream *substream) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 391 | { |
| 392 | snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); |
| 393 | |
| 394 | clear_bit(0, &chip->opened); |
| 395 | smp_mb__after_clear_bit(); |
| 396 | |
| 397 | return 0; |
| 398 | } |
| 399 | |
| 400 | /* |
| 401 | * hw_params callback |
| 402 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 403 | static int snd_cx88_hw_params(struct snd_pcm_substream * substream, |
| 404 | struct snd_pcm_hw_params * hw_params) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 405 | { |
| 406 | snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); |
| 407 | struct cx88_buffer *buf; |
| 408 | |
| 409 | if (substream->runtime->dma_area) { |
| 410 | dsp_buffer_free(chip); |
| 411 | substream->runtime->dma_area = NULL; |
| 412 | } |
| 413 | |
| 414 | |
| 415 | chip->period_size = params_period_bytes(hw_params); |
| 416 | chip->num_periods = params_periods(hw_params); |
| 417 | chip->dma_size = chip->period_size * params_periods(hw_params); |
| 418 | |
| 419 | BUG_ON(!chip->dma_size); |
| 420 | |
| 421 | dprintk(1,"Setting buffer\n"); |
| 422 | |
| vignesh.babu@wipro.com | c42cabe | 2007-04-16 10:34:33 -0300 | [diff] [blame] | 423 | buf = kzalloc(sizeof(*buf),GFP_KERNEL); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 424 | if (NULL == buf) |
| 425 | return -ENOMEM; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 426 | |
| 427 | buf->vb.memory = V4L2_MEMORY_MMAP; |
| 428 | buf->vb.width = chip->period_size; |
| 429 | buf->vb.height = chip->num_periods; |
| 430 | buf->vb.size = chip->dma_size; |
| 431 | buf->vb.field = V4L2_FIELD_NONE; |
| 432 | |
| 433 | videobuf_dma_init(&buf->vb.dma); |
| 434 | videobuf_dma_init_kernel(&buf->vb.dma,PCI_DMA_FROMDEVICE, |
| 435 | (PAGE_ALIGN(buf->vb.size) >> PAGE_SHIFT)); |
| 436 | |
| Mauro Carvalho Chehab | c7b0ac0 | 2006-03-10 12:29:15 -0300 | [diff] [blame] | 437 | videobuf_pci_dma_map(chip->pci,&buf->vb.dma); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 438 | |
| 439 | |
| 440 | cx88_risc_databuffer(chip->pci, &buf->risc, |
| 441 | buf->vb.dma.sglist, |
| 442 | buf->vb.width, buf->vb.height); |
| 443 | |
| 444 | buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); |
| 445 | buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma); |
| 446 | |
| 447 | buf->vb.state = STATE_PREPARED; |
| 448 | |
| 449 | buf->bpl = chip->period_size; |
| 450 | chip->buf = buf; |
| 451 | chip->dma_risc = buf->vb.dma; |
| 452 | |
| 453 | dprintk(1,"Buffer ready at %u\n",chip->dma_risc.nr_pages); |
| 454 | substream->runtime->dma_area = chip->dma_risc.vmalloc; |
| 455 | return 0; |
| 456 | } |
| 457 | |
| 458 | /* |
| 459 | * hw free callback |
| 460 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 461 | static int snd_cx88_hw_free(struct snd_pcm_substream * substream) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 462 | { |
| 463 | |
| 464 | snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); |
| 465 | |
| 466 | if (substream->runtime->dma_area) { |
| 467 | dsp_buffer_free(chip); |
| 468 | substream->runtime->dma_area = NULL; |
| 469 | } |
| 470 | |
| 471 | return 0; |
| 472 | } |
| 473 | |
| 474 | /* |
| 475 | * prepare callback |
| 476 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 477 | static int snd_cx88_prepare(struct snd_pcm_substream *substream) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 478 | { |
| 479 | return 0; |
| 480 | } |
| 481 | |
| 482 | |
| 483 | /* |
| 484 | * trigger callback |
| 485 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 486 | static int snd_cx88_card_trigger(struct snd_pcm_substream *substream, int cmd) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 487 | { |
| 488 | snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); |
| 489 | int err; |
| 490 | |
| 491 | spin_lock(&chip->reg_lock); |
| 492 | |
| 493 | switch (cmd) { |
| 494 | case SNDRV_PCM_TRIGGER_START: |
| 495 | err=_cx88_start_audio_dma(chip); |
| 496 | break; |
| 497 | case SNDRV_PCM_TRIGGER_STOP: |
| 498 | err=_cx88_stop_audio_dma(chip); |
| 499 | break; |
| 500 | default: |
| 501 | err=-EINVAL; |
| 502 | break; |
| 503 | } |
| 504 | |
| 505 | spin_unlock(&chip->reg_lock); |
| 506 | |
| 507 | return err; |
| 508 | } |
| 509 | |
| 510 | /* |
| 511 | * pointer callback |
| 512 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 513 | static snd_pcm_uframes_t snd_cx88_pointer(struct snd_pcm_substream *substream) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 514 | { |
| 515 | snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 516 | struct snd_pcm_runtime *runtime = substream->runtime; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 517 | |
| 518 | if (chip->read_count) { |
| 519 | chip->read_count -= snd_pcm_lib_period_bytes(substream); |
| 520 | chip->read_offset += snd_pcm_lib_period_bytes(substream); |
| 521 | if (chip->read_offset == chip->dma_size) |
| 522 | chip->read_offset = 0; |
| 523 | } |
| 524 | |
| 525 | dprintk(2, "Pointer time, will return %li, read %li\n",chip->read_offset,chip->read_count); |
| 526 | return bytes_to_frames(runtime, chip->read_offset); |
| 527 | |
| 528 | } |
| 529 | |
| 530 | /* |
| 531 | * operators |
| 532 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 533 | static struct snd_pcm_ops snd_cx88_pcm_ops = { |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 534 | .open = snd_cx88_pcm_open, |
| 535 | .close = snd_cx88_close, |
| 536 | .ioctl = snd_pcm_lib_ioctl, |
| 537 | .hw_params = snd_cx88_hw_params, |
| 538 | .hw_free = snd_cx88_hw_free, |
| 539 | .prepare = snd_cx88_prepare, |
| 540 | .trigger = snd_cx88_card_trigger, |
| 541 | .pointer = snd_cx88_pointer, |
| 542 | }; |
| 543 | |
| 544 | /* |
| 545 | * create a PCM device |
| 546 | */ |
| 547 | static int __devinit snd_cx88_pcm(snd_cx88_card_t *chip, int device, char *name) |
| 548 | { |
| 549 | int err; |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 550 | struct snd_pcm *pcm; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 551 | |
| 552 | err = snd_pcm_new(chip->card, name, device, 0, 1, &pcm); |
| 553 | if (err < 0) |
| 554 | return err; |
| 555 | pcm->private_data = chip; |
| 556 | strcpy(pcm->name, name); |
| 557 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx88_pcm_ops); |
| 558 | |
| 559 | return 0; |
| 560 | } |
| 561 | |
| 562 | /**************************************************************************** |
| 563 | CONTROL INTERFACE |
| 564 | ****************************************************************************/ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 565 | static int snd_cx88_capture_volume_info(struct snd_kcontrol *kcontrol, |
| 566 | struct snd_ctl_elem_info *info) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 567 | { |
| 568 | info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
| 569 | info->count = 1; |
| 570 | info->value.integer.min = 0; |
| 571 | info->value.integer.max = 0x3f; |
| 572 | |
| 573 | return 0; |
| 574 | } |
| 575 | |
| 576 | /* OK - TODO: test it */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 577 | static int snd_cx88_capture_volume_get(struct snd_kcontrol *kcontrol, |
| 578 | struct snd_ctl_elem_value *value) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 579 | { |
| 580 | snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); |
| 581 | struct cx88_core *core=chip->core; |
| 582 | |
| 583 | value->value.integer.value[0] = 0x3f - (cx_read(AUD_VOL_CTL) & 0x3f); |
| 584 | |
| 585 | return 0; |
| 586 | } |
| 587 | |
| 588 | /* OK - TODO: test it */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 589 | static int snd_cx88_capture_volume_put(struct snd_kcontrol *kcontrol, |
| 590 | struct snd_ctl_elem_value *value) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 591 | { |
| 592 | snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); |
| 593 | struct cx88_core *core=chip->core; |
| 594 | int v; |
| 595 | u32 old_control; |
| 596 | |
| 597 | spin_lock_irq(&chip->reg_lock); |
| 598 | old_control = 0x3f - (cx_read(AUD_VOL_CTL) & 0x3f); |
| 599 | v = 0x3f - (value->value.integer.value[0] & 0x3f); |
| 600 | cx_andor(AUD_VOL_CTL, 0x3f, v); |
| 601 | spin_unlock_irq(&chip->reg_lock); |
| 602 | |
| 603 | return v != old_control; |
| 604 | } |
| 605 | |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 606 | static struct snd_kcontrol_new snd_cx88_capture_volume = { |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 607 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 608 | .name = "Capture Volume", |
| 609 | .info = snd_cx88_capture_volume_info, |
| 610 | .get = snd_cx88_capture_volume_get, |
| 611 | .put = snd_cx88_capture_volume_put, |
| 612 | }; |
| 613 | |
| 614 | |
| 615 | /**************************************************************************** |
| 616 | Basic Flow for Sound Devices |
| 617 | ****************************************************************************/ |
| 618 | |
| 619 | /* |
| 620 | * PCI ID Table - 14f1:8801 and 14f1:8811 means function 1: Audio |
| 621 | * Only boards with eeprom and byte 1 at eeprom=1 have it |
| 622 | */ |
| 623 | |
| Henrik Kretzschmar | 396c9b9 | 2006-04-24 15:59:04 +0200 | [diff] [blame] | 624 | static struct pci_device_id cx88_audio_pci_tbl[] __devinitdata = { |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 625 | {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, |
| 626 | {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, |
| 627 | {0, } |
| 628 | }; |
| 629 | MODULE_DEVICE_TABLE(pci, cx88_audio_pci_tbl); |
| 630 | |
| 631 | /* |
| 632 | * Chip-specific destructor |
| 633 | */ |
| 634 | |
| 635 | static int snd_cx88_free(snd_cx88_card_t *chip) |
| 636 | { |
| 637 | |
| 638 | if (chip->irq >= 0){ |
| 639 | synchronize_irq(chip->irq); |
| 640 | free_irq(chip->irq, chip); |
| 641 | } |
| 642 | |
| 643 | cx88_core_put(chip->core,chip->pci); |
| 644 | |
| 645 | pci_disable_device(chip->pci); |
| 646 | return 0; |
| 647 | } |
| 648 | |
| 649 | /* |
| 650 | * Component Destructor |
| 651 | */ |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 652 | static void snd_cx88_dev_free(struct snd_card * card) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 653 | { |
| 654 | snd_cx88_card_t *chip = card->private_data; |
| 655 | |
| 656 | snd_cx88_free(chip); |
| 657 | } |
| 658 | |
| 659 | |
| 660 | /* |
| 661 | * Alsa Constructor - Component probe |
| 662 | */ |
| 663 | |
| Mauro Carvalho Chehab | a5ed425 | 2006-01-13 14:10:19 -0200 | [diff] [blame] | 664 | static int devno; |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 665 | static int __devinit snd_cx88_create(struct snd_card *card, |
| 666 | struct pci_dev *pci, |
| 667 | snd_cx88_card_t **rchip) |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 668 | { |
| 669 | snd_cx88_card_t *chip; |
| 670 | struct cx88_core *core; |
| 671 | int err; |
| 672 | |
| 673 | *rchip = NULL; |
| 674 | |
| 675 | err = pci_enable_device(pci); |
| 676 | if (err < 0) |
| 677 | return err; |
| 678 | |
| 679 | pci_set_master(pci); |
| 680 | |
| 681 | chip = (snd_cx88_card_t *) card->private_data; |
| 682 | |
| 683 | core = cx88_core_get(pci); |
| Duncan Sands | 31dcbf9 | 2006-03-14 12:12:39 -0300 | [diff] [blame] | 684 | if (NULL == core) { |
| 685 | err = -EINVAL; |
| 686 | kfree (chip); |
| 687 | return err; |
| 688 | } |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 689 | |
| Mauro Carvalho Chehab | aaa40cb | 2007-03-30 10:58:01 -0300 | [diff] [blame] | 690 | if (!pci_dma_supported(pci,DMA_32BIT_MASK)) { |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 691 | dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name); |
| 692 | err = -EIO; |
| 693 | cx88_core_put(core,pci); |
| 694 | return err; |
| 695 | } |
| 696 | |
| 697 | |
| 698 | /* pci init */ |
| 699 | chip->card = card; |
| 700 | chip->pci = pci; |
| 701 | chip->irq = -1; |
| 702 | spin_lock_init(&chip->reg_lock); |
| 703 | |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 704 | chip->core = core; |
| 705 | |
| 706 | /* get irq */ |
| 707 | err = request_irq(chip->pci->irq, cx8801_irq, |
| Thomas Gleixner | 8076fe3 | 2006-07-01 19:29:37 -0700 | [diff] [blame] | 708 | IRQF_SHARED | IRQF_DISABLED, chip->core->name, chip); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 709 | if (err < 0) { |
| 710 | dprintk(0, "%s: can't get IRQ %d\n", |
| 711 | chip->core->name, chip->pci->irq); |
| 712 | return err; |
| 713 | } |
| 714 | |
| 715 | /* print pci info */ |
| 716 | pci_read_config_byte(pci, PCI_CLASS_REVISION, &chip->pci_rev); |
| 717 | pci_read_config_byte(pci, PCI_LATENCY_TIMER, &chip->pci_lat); |
| 718 | |
| 719 | dprintk(1,"ALSA %s/%i: found at %s, rev: %d, irq: %d, " |
| Greg Kroah-Hartman | 228aef6 | 2006-06-12 15:16:52 -0700 | [diff] [blame] | 720 | "latency: %d, mmio: 0x%llx\n", core->name, devno, |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 721 | pci_name(pci), chip->pci_rev, pci->irq, |
| Greg Kroah-Hartman | 228aef6 | 2006-06-12 15:16:52 -0700 | [diff] [blame] | 722 | chip->pci_lat,(unsigned long long)pci_resource_start(pci,0)); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 723 | |
| 724 | chip->irq = pci->irq; |
| 725 | synchronize_irq(chip->irq); |
| 726 | |
| 727 | snd_card_set_dev(card, &pci->dev); |
| 728 | |
| 729 | *rchip = chip; |
| 730 | |
| 731 | return 0; |
| 732 | } |
| 733 | |
| 734 | static int __devinit cx88_audio_initdev(struct pci_dev *pci, |
| 735 | const struct pci_device_id *pci_id) |
| 736 | { |
| Takashi Iwai | f7cbb7f | 2006-01-13 18:48:06 +0100 | [diff] [blame] | 737 | struct snd_card *card; |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 738 | snd_cx88_card_t *chip; |
| 739 | int err; |
| 740 | |
| 741 | if (devno >= SNDRV_CARDS) |
| 742 | return (-ENODEV); |
| 743 | |
| 744 | if (!enable[devno]) { |
| 745 | ++devno; |
| 746 | return (-ENOENT); |
| 747 | } |
| 748 | |
| 749 | card = snd_card_new(index[devno], id[devno], THIS_MODULE, sizeof(snd_cx88_card_t)); |
| 750 | if (!card) |
| 751 | return (-ENOMEM); |
| 752 | |
| 753 | card->private_free = snd_cx88_dev_free; |
| 754 | |
| 755 | err = snd_cx88_create(card, pci, &chip); |
| 756 | if (err < 0) |
| 757 | return (err); |
| 758 | |
| 759 | err = snd_cx88_pcm(chip, 0, "CX88 Digital"); |
| 760 | |
| 761 | if (err < 0) { |
| 762 | snd_card_free(card); |
| 763 | return (err); |
| 764 | } |
| 765 | |
| 766 | err = snd_ctl_add(card, snd_ctl_new1(&snd_cx88_capture_volume, chip)); |
| 767 | if (err < 0) { |
| 768 | snd_card_free(card); |
| 769 | return (err); |
| 770 | } |
| 771 | |
| 772 | strcpy (card->driver, "CX88x"); |
| 773 | sprintf(card->shortname, "Conexant CX%x", pci->device); |
| Greg Kroah-Hartman | 228aef6 | 2006-06-12 15:16:52 -0700 | [diff] [blame] | 774 | sprintf(card->longname, "%s at %#llx", |
| 775 | card->shortname,(unsigned long long)pci_resource_start(pci, 0)); |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 776 | strcpy (card->mixername, "CX88"); |
| 777 | |
| 778 | dprintk (0, "%s/%i: ALSA support for cx2388x boards\n", |
| 779 | card->driver,devno); |
| 780 | |
| 781 | err = snd_card_register(card); |
| 782 | if (err < 0) { |
| 783 | snd_card_free(card); |
| 784 | return (err); |
| 785 | } |
| 786 | snd_cx88_cards[devno] = card; |
| 787 | |
| 788 | pci_set_drvdata(pci,card); |
| 789 | |
| 790 | devno++; |
| 791 | return 0; |
| 792 | } |
| 793 | /* |
| 794 | * ALSA destructor |
| 795 | */ |
| 796 | static void __devexit cx88_audio_finidev(struct pci_dev *pci) |
| 797 | { |
| 798 | struct cx88_audio_dev *card = pci_get_drvdata(pci); |
| 799 | |
| 800 | snd_card_free((void *)card); |
| 801 | |
| 802 | pci_set_drvdata(pci, NULL); |
| 803 | |
| 804 | devno--; |
| 805 | } |
| 806 | |
| 807 | /* |
| 808 | * PCI driver definition |
| 809 | */ |
| 810 | |
| 811 | static struct pci_driver cx88_audio_pci_driver = { |
| 812 | .name = "cx88_audio", |
| 813 | .id_table = cx88_audio_pci_tbl, |
| 814 | .probe = cx88_audio_initdev, |
| 815 | .remove = cx88_audio_finidev, |
| Mauro Carvalho Chehab | b7f355d | 2006-01-09 15:32:44 -0200 | [diff] [blame] | 816 | }; |
| 817 | |
| 818 | /**************************************************************************** |
| 819 | LINUX MODULE INIT |
| 820 | ****************************************************************************/ |
| 821 | |
| 822 | /* |
| 823 | * module init |
| 824 | */ |
| 825 | static int cx88_audio_init(void) |
| 826 | { |
| 827 | printk(KERN_INFO "cx2388x alsa driver version %d.%d.%d loaded\n", |
| 828 | (CX88_VERSION_CODE >> 16) & 0xff, |
| 829 | (CX88_VERSION_CODE >> 8) & 0xff, |
| 830 | CX88_VERSION_CODE & 0xff); |
| 831 | #ifdef SNAPSHOT |
| 832 | printk(KERN_INFO "cx2388x: snapshot date %04d-%02d-%02d\n", |
| 833 | SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100); |
| 834 | #endif |
| 835 | return pci_register_driver(&cx88_audio_pci_driver); |
| 836 | } |
| 837 | |
| 838 | /* |
| 839 | * module remove |
| 840 | */ |
| 841 | static void cx88_audio_fini(void) |
| 842 | { |
| 843 | |
| 844 | pci_unregister_driver(&cx88_audio_pci_driver); |
| 845 | } |
| 846 | |
| 847 | module_init(cx88_audio_init); |
| 848 | module_exit(cx88_audio_fini); |
| 849 | |
| 850 | /* ----------------------------------------------------------- */ |
| 851 | /* |
| 852 | * Local variables: |
| 853 | * c-basic-offset: 8 |
| 854 | * End: |
| 855 | */ |