aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
Commit message (Expand)AuthorAge
* [PATCH] update Documentation/00-INDEXGreg Kroah-Hartman2005-11-18
* [PATCH] Add HOWTO do kernel development document to the Documentation directoryGreg Kroah-Hartman2005-11-18
* [PATCH] USB: Delete leftovers from bluetty driverMarcel Holtmann2005-11-17
* [MIPS] feature-removal-schedule.txt: Schedule au1x00_uart for removal.Ralf Baechle2005-11-17
* [PATCH] oops-tracing: mention extended VGADave Jones2005-11-15
* [PATCH] Update location of ll_rw_blk.c in docsBen Collins2005-11-15
* [PATCH] md: mark START_ARRAY deprecated with a dateNeilBrown2005-11-15
* Merge x86-64 update from AndiLinus Torvalds2005-11-14
|\
| * [PATCH] x86_64: Remove CONFIG_CHECKING and add command line option for pagefa...Andi Kleen2005-11-14
| * [PATCH] x86_64: Log machine checks from boot on Intel systemsAndi Kleen2005-11-14
| * [PATCH] x86_64: New heuristics to find out hotpluggable CPUs.Andi Kleen2005-11-14
| * [PATCH] x86_64: Some clarifications for Documention/x86_64/mm.txtAndi Kleen2005-11-14
* | [PATCH] DocBook: revert xmlto use for .ps and .pdf documentationMartin Waitz2005-11-13
* | [PATCH] DocBook: comment about paper typeMartin Waitz2005-11-13
* | [PATCH] DocBook: include printk documentationMartin Waitz2005-11-13
* | [PATCH] v4l: (962) Added new saa7134 card (MSI TV@anywhere plus)Ricardo Cerqueira2005-11-13
* | [PATCH] v4l:: (936) Support for sabrent bt848 versionBill Pechter2005-11-13
* | [PATCH] oops-tracing: mention digital photosDiego Calleja2005-11-13
* | [PATCH] atomic: inc_not_zeroNick Piggin2005-11-13
* | [PATCH] atomic: cmpxchgNick Piggin2005-11-13
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivialLinus Torvalds2005-11-11
|\ \
| * | earlyuserspace/README: fix homonym errJim Cromie2005-11-08
* | | Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6Linus Torvalds2005-11-11
|\ \ \
| * \ \ Merge by hand (whitespace conflicts in libata.h)James Bottomley2005-11-10
| |\ \ \
| * | | | [SCSI] remove Scsi_Device typedefChristoph Hellwig2005-11-09
| * | | | [SCSI] remove Scsi_Host_Template typedefChristoph Hellwig2005-11-09
| * | | | Merge by hand (conflicts between pending drivers and kfree cleanups)James Bottomley2005-11-08
| |\ \ \ \ | | |_|/ / | |/| | |
| | * | | [SCSI] cciss: scsi error handlingmike.miller@hp.com2005-11-06
| | * | | [SCSI] remove the obsolete SCSI qlogicisp driverAdrian Bunk2005-11-06
| | * | | [SCSI] Documentation: typo in scsi/scsi_eh.txtStefan Richter2005-11-06
* | | | | [TCP]: Appropriate Byte Count supportStephen Hemminger2005-11-10
* | | | | [DCCP]: Create Documentation/networking/dccp.txtIan McDonald2005-11-10
| |_|/ / |/| | |
* | | | Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6Linus Torvalds2005-11-09
|\ \ \ \
| * | | | [PATCH] i2c-viapro: Some adjustmentsJean Delvare2005-11-08
| * | | | [PATCH] i2c: writing-client doc update complementJean Delvare2005-11-08
| |/ / /
* | | | Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/...Linus Torvalds2005-11-09
|\ \ \ \
| * \ \ \ Merge rsync://bughost.org/repos/ipw-delta/Jeff Garzik2005-11-09
| |\ \ \ \ | | |/ / / | |/| | |
| | * | | Updated READMEs and MAINTAINERS for the ipw2100 and ipw2200 drivers.James Ketrenos2005-11-07
* | | | | [PATCH] md: document sysfs usage of md, and make a couple of small refinementsNeilBrown2005-11-09
* | | | | [PATCH] fbcon: Console Rotation - Add framebuffer console documentationAntonino A. Daplas2005-11-09
* | | | | [PATCH] sched: resched and cpu_idle reworkNick Piggin2005-11-09
* | | | | [PATCH] V4L: removal schedule for V4L1 APIMauro Carvalho Chehab2005-11-09
* | | | | [PATCH] V4L: 915: fixes compilation problems due removal of media/id.h and i2...Hans Verkuil2005-11-09
* | | | | [PATCH] V4L: 909: updated cardlist and strip trailing whitespaceMichael Krufky2005-11-09
* | | | | [PATCH] V4L: 906: remote and more info for pctv cardbus whitespace cleanupPavel Mihaylov2005-11-09
* | | | | [PATCH] v4l: 895: new avermedia 303 card without radioLubomir Bulej2005-11-09
* | | | | [PATCH] v4l: 863: added pinnacle dazzle dvc 90Mauro Carvalho Chehab2005-11-09
* | | | | [PATCH] v4l: 851: fixed broken api link and indentationNickolay V. Shmyrev2005-11-09
* | | | | [PATCH] v4l: 847: fix bug 5484 asus digimatrix card doesnt work with pal tunerMichael Krufky2005-11-09
* | | | | [PATCH] v4l: 838: modified settings for msi vox usb 2.0Markus Rechberger2005-11-09
class="hl num">2, .periods_max = 1024, .fifo_size = 0, }; static void ct_atc_pcm_interrupt(struct ct_atc_pcm *atc_pcm) { struct ct_atc_pcm *apcm = atc_pcm; if (NULL == apcm->substream) return; snd_pcm_period_elapsed(apcm->substream); } static void ct_atc_pcm_free_substream(struct snd_pcm_runtime *runtime) { struct ct_atc_pcm *apcm = runtime->private_data; struct ct_atc *atc = snd_pcm_substream_chip(apcm->substream); atc->pcm_release_resources(atc, apcm); ct_timer_instance_free(apcm->timer); kfree(apcm); runtime->private_data = NULL; } /* pcm playback operations */ static int ct_pcm_playback_open(struct snd_pcm_substream *substream) { struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm; int err; apcm = kzalloc(sizeof(*apcm), GFP_KERNEL); if (NULL == apcm) return -ENOMEM; apcm->substream = substream; apcm->interrupt = ct_atc_pcm_interrupt; runtime->private_data = apcm; runtime->private_free = ct_atc_pcm_free_substream; if (IEC958 == substream->pcm->device) { runtime->hw = ct_spdif_passthru_playback_hw; atc->spdif_out_passthru(atc, 1); } else { runtime->hw = ct_pcm_playback_hw; if (FRONT == substream->pcm->device) runtime->hw.channels_max = 8; } err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); if (err < 0) { kfree(apcm); return err; } err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1024, UINT_MAX); if (err < 0) { kfree(apcm); return err; } apcm->timer = ct_timer_instance_new(atc->timer, apcm); if (!apcm->timer) return -ENOMEM; return 0; } static int ct_pcm_playback_close(struct snd_pcm_substream *substream) { struct ct_atc *atc = snd_pcm_substream_chip(substream); /* TODO: Notify mixer inactive. */ if (IEC958 == substream->pcm->device) atc->spdif_out_passthru(atc, 0); /* The ct_atc_pcm object will be freed by runtime->private_free */ return 0; } static int ct_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { struct ct_atc *atc = snd_pcm_substream_chip(substream); struct ct_atc_pcm *apcm = substream->runtime->private_data; int err; err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); if (err < 0) return err; /* clear previous resources */ atc->pcm_release_resources(atc, apcm); return err; } static int ct_pcm_hw_free(struct snd_pcm_substream *substream) { struct ct_atc *atc = snd_pcm_substream_chip(substream); struct ct_atc_pcm *apcm = substream->runtime->private_data; /* clear previous resources */ atc->pcm_release_resources(atc, apcm); /* Free snd-allocated pages */ return snd_pcm_lib_free_pages(substream); } static int ct_pcm_playback_prepare(struct snd_pcm_substream *substream) { int err; struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = runtime->private_data; if (IEC958 == substream->pcm->device) err = atc->spdif_passthru_playback_prepare(atc, apcm); else err = atc->pcm_playback_prepare(atc, apcm); if (err < 0) { printk(KERN_ERR "ctxfi: Preparing pcm playback failed!!!\n"); return err; } return 0; } static int ct_pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) { struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = runtime->private_data; switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: atc->pcm_playback_start(atc, apcm); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: atc->pcm_playback_stop(atc, apcm); break; default: break; } return 0; } static snd_pcm_uframes_t ct_pcm_playback_pointer(struct snd_pcm_substream *substream) { unsigned long position; struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = runtime->private_data; /* Read out playback position */ position = atc->pcm_playback_position(atc, apcm); position = bytes_to_frames(runtime, position); if (position >= runtime->buffer_size) position = 0; return position; } /* pcm capture operations */ static int ct_pcm_capture_open(struct snd_pcm_substream *substream) { struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm; int err; apcm = kzalloc(sizeof(*apcm), GFP_KERNEL); if (NULL == apcm) return -ENOMEM; apcm->started = 0; apcm->substream = substream; apcm->interrupt = ct_atc_pcm_interrupt; runtime->private_data = apcm; runtime->private_free = ct_atc_pcm_free_substream; runtime->hw = ct_pcm_capture_hw; runtime->hw.rate_max = atc->rsr * atc->msr; err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); if (err < 0) { kfree(apcm); return err; } err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1024, UINT_MAX); if (err < 0) { kfree(apcm); return err; } apcm->timer = ct_timer_instance_new(atc->timer, apcm); if (!apcm->timer) return -ENOMEM; return 0; } static int ct_pcm_capture_close(struct snd_pcm_substream *substream) { /* The ct_atc_pcm object will be freed by runtime->private_free */ /* TODO: Notify mixer inactive. */ return 0; } static int ct_pcm_capture_prepare(struct snd_pcm_substream *substream) { int err; struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = runtime->private_data; err = atc->pcm_capture_prepare(atc, apcm); if (err < 0) { printk(KERN_ERR "ctxfi: Preparing pcm capture failed!!!\n"); return err; } return 0; } static int ct_pcm_capture_trigger(struct snd_pcm_substream *substream, int cmd) { struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = runtime->private_data; switch (cmd) { case SNDRV_PCM_TRIGGER_START: atc->pcm_capture_start(atc, apcm); break; case SNDRV_PCM_TRIGGER_STOP: atc->pcm_capture_stop(atc, apcm); break; default: atc->pcm_capture_stop(atc, apcm); break; } return 0; } static snd_pcm_uframes_t ct_pcm_capture_pointer(struct snd_pcm_substream *substream) { unsigned long position; struct ct_atc *atc = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = runtime->private_data; /* Read out playback position */ position = atc->pcm_capture_position(atc, apcm); position = bytes_to_frames(runtime, position); if (position >= runtime->buffer_size) position = 0; return position; } /* PCM operators for playback */ static struct snd_pcm_ops ct_pcm_playback_ops = { .open = ct_pcm_playback_open, .close = ct_pcm_playback_close, .ioctl = snd_pcm_lib_ioctl, .hw_params = ct_pcm_hw_params, .hw_free = ct_pcm_hw_free, .prepare = ct_pcm_playback_prepare, .trigger = ct_pcm_playback_trigger, .pointer = ct_pcm_playback_pointer, .page = snd_pcm_sgbuf_ops_page, }; /* PCM operators for capture */ static struct snd_pcm_ops ct_pcm_capture_ops = { .open = ct_pcm_capture_open, .close = ct_pcm_capture_close, .ioctl = snd_pcm_lib_ioctl, .hw_params = ct_pcm_hw_params, .hw_free = ct_pcm_hw_free, .prepare = ct_pcm_capture_prepare, .trigger = ct_pcm_capture_trigger, .pointer = ct_pcm_capture_pointer, .page = snd_pcm_sgbuf_ops_page, }; /* Create ALSA pcm device */ int ct_alsa_pcm_create(struct ct_atc *atc, enum CTALSADEVS device, const char *device_name) { struct snd_pcm *pcm; int err; int playback_count, capture_count; playback_count = (IEC958 == device) ? 1 : 8; capture_count = (FRONT == device) ? 1 : 0; err = snd_pcm_new(atc->card, "ctxfi", device, playback_count, capture_count, &pcm); if (err < 0) { printk(KERN_ERR "ctxfi: snd_pcm_new failed!! Err=%d\n", err); return err; } pcm->private_data = atc; pcm->info_flags = 0; pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX; strlcpy(pcm->name, device_name, sizeof(pcm->name)); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &ct_pcm_playback_ops); if (FRONT == device) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &ct_pcm_capture_ops); snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(atc->pci), 128*1024, 128*1024); #ifdef CONFIG_PM atc->pcms[device] = pcm; #endif return 0; }