summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-08-13 22:59:49 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-08-13 22:59:49 +0000
commitebf955bdb7ff6fcb7232b9f968ff0b66c53a2b97 (patch)
treebe981d6b995aa11c72e3e2170a653d3d0e2253f2
parentc591931676f766fe4714edc3676d6a981eb38b59 (diff)
downloadmediapointer-dvb-s2-ebf955bdb7ff6fcb7232b9f968ff0b66c53a2b97.tar.gz
mediapointer-dvb-s2-ebf955bdb7ff6fcb7232b9f968ff0b66c53a2b97.tar.bz2
cx88-alsa.c:
- snd register working. Also Capture control. - pending: pcm functions and fix some trouble when inserting it with other cx88 functions (cx8800) for example. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
-rw-r--r--linux/drivers/media/video/cx88/cx88-alsa.c543
-rw-r--r--v4l/ChangeLog9
2 files changed, 262 insertions, 290 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c
index c4b2b1ddf..67c885e31 100644
--- a/linux/drivers/media/video/cx88/cx88-alsa.c
+++ b/linux/drivers/media/video/cx88/cx88-alsa.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-alsa.c,v 1.5 2005/08/10 17:01:28 mchehab Exp $
+ * $Id: cx88-alsa.c,v 1.6 2005/08/13 22:59:49 mchehab Exp $
*
* Support for audio capture
* PCI function #1 of the cx2388x.
@@ -38,6 +38,7 @@
#include "compat.h"
#include "cx88.h"
+#include "cx88-reg.h"
/****************************************************************************
Data type declarations - Can be moded to a header file later
@@ -55,7 +56,6 @@ enum { DEVICE_DIGITAL, DEVICE_ANALOG };
/* These can be replaced after done */
#define MIXER_ADDR_LAST MAX_CX88_INPUT
-//#define SNDRV_CARDS CX88_MAXBOARDS
struct cx88_audio_dev {
struct cx88_core *core;
@@ -67,6 +67,7 @@ struct cx88_audio_dev {
unsigned char pci_rev,pci_lat;
/* audio controls */
+ int irq;
int dig_rate; /* Digital sampling rate */
snd_card_t *card;
@@ -90,11 +91,15 @@ typedef struct cx88_audio_dev snd_cx88_card_t;
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
-static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
+static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1};
+#if 0
static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
-
static snd_cx88_card_t *snd_dummy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
+#endif
+
+module_param_array(enable, bool, NULL, 0444);
+MODULE_PARM_DESC(enable, "Enable cx88x soundcard. default enabled.");
/****************************************************************************
Module macros
@@ -103,124 +108,14 @@ static snd_cx88_card_t *snd_dummy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards");
MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@brturbo.com.br>");
MODULE_LICENSE("GPL");
+MODULE_SUPPORTED_DEVICE("{{Conexant,23881},"
+ "{{Conexant,23882},"
+ "{{Conexant,23883}");
/****************************************************************************
- Part 1: Basic Flow for Sound Devices
+ Module useful unused functions
****************************************************************************/
/*
- * PCI ID Table
- */
-
-struct pci_device_id cx88_audio_pci_tbl[] = {
- {
- .vendor = 0x14f1,
- .device = 0x8800,
- .subvendor = PCI_ANY_ID,
- .subdevice = PCI_ANY_ID,
- },{
- .vendor = 0x14f1,
- .device = 0x8801,
- .subvendor = PCI_ANY_ID,
- .subdevice = PCI_ANY_ID,
- },{
- .vendor = 0x14f1,
- .device = 0x8811,
- .subvendor = PCI_ANY_ID,
- .subdevice = PCI_ANY_ID,
- },{
- /* --- end of list --- */
- }
-};
-MODULE_DEVICE_TABLE(pci, cx88_audio_pci_tbl);
-
-/*
- * Alsa Constructor - Component probe
- */
-static int __devinit cx88_audio_initdev(struct pci_dev *pci_dev,
- const struct pci_device_id *pci_id)
-{
- snd_cx88_card_t *dev;
- struct cx88_core *core;
- int err;
-
- dev = kmalloc(sizeof(*dev),GFP_KERNEL);
- if (NULL == dev)
- return -ENOMEM;
- memset(dev,0,sizeof(*dev));
-
- /* pci init */
- dev->pci = pci_dev;
- if (pci_enable_device(pci_dev)) {
- err = -EIO;
- goto fail_free;
- }
- core = cx88_core_get(dev->pci);
- if (NULL == core) {
- err = -EINVAL;
- goto fail_free;
- }
- dev->core = core;
-
- /* print pci info */
- pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
- pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat);
- printk(KERN_INFO "%s/1: found at %s, rev: %d, irq: %d, "
- "latency: %d, mmio: 0x%lx\n", core->name,
- pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
- dev->pci_lat,pci_resource_start(pci_dev,0));
-
- pci_set_master(pci_dev);
- if (!pci_dma_supported(pci_dev,0xffffffff)) {
- printk("%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
- err = -EIO;
- goto fail_core;
- }
-
- printk("%s/1: Alsa support for cx2388x boards\n",
- core->name);
- pci_set_drvdata(pci_dev,dev);
- return 0;
-
- fail_core:
- cx88_core_put(core,dev->pci);
- fail_free:
- kfree(dev);
- return err;
-}
-
-/*
- * ALSA destructor
- */
-static void __devexit cx88_audio_finidev(struct pci_dev *pci_dev)
-{
- snd_cx88_card_t *dev = pci_get_drvdata(pci_dev);
-
- pci_disable_device(pci_dev);
-
- /* unregister stuff */
- pci_set_drvdata(pci_dev, NULL);
-
- /* free memory */
- cx88_core_put(dev->core,dev->pci);
- kfree(dev);
-}
-
-/*
- * PCI driver definition
- */
-
-static struct pci_driver cx88_audio_pci_driver = {
- .name = "cx88_audio",
- .id_table = cx88_audio_pci_tbl,
- .probe = cx88_audio_initdev,
- .remove = cx88_audio_finidev,
-#if 0
- .suspend = cx88_audio_suspend,
- .resume = cx88_audio_resume,
-#endif
-};
-
-/*
=====================> FIXME
*/
@@ -277,27 +172,6 @@ static snd_pcm_hardware_t snd_cx88_digital_hw = {
};
/*
- * Analog hardware definition
- */
-static snd_pcm_hardware_t snd_cx88_analog_hw = {
- .info = SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_INTERLEAVED |
- SNDRV_PCM_INFO_BLOCK_TRANSFER |
- SNDRV_PCM_INFO_MMAP_VALID,
- .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8,
- .rates = SNDRV_PCM_RATE_KNOT,
- .rate_min = ANALOG_CLOCK / CLOCK_DIV_MAX,
- .rate_max = ANALOG_CLOCK / CLOCK_DIV_MIN,
- .channels_min = 1,
- .channels_max = 1,
- .buffer_bytes_max = 255 * 4092,
- .period_bytes_min = 32,
- .period_bytes_max = 4092,
- .periods_min = 2,
- .periods_max = 255,
-};
-
-/*
* Sets board to provide digital audio
*/
static int snd_cx88_set_digital_hw(snd_cx88_card_t *chip, snd_pcm_runtime_t *runtime)
@@ -331,30 +205,6 @@ static int snd_cx88_set_digital_hw(snd_cx88_card_t *chip, snd_pcm_runtime_t *run
}
/*
- * Sets board to provide analog audio
- */
-static int snd_cx88_set_analog_hw(snd_cx88_card_t *core, snd_pcm_runtime_t *runtime)
-{
- static ratnum_t analog_clock = {
- .num = ANALOG_CLOCK,
- .den_min = CLOCK_DIV_MIN,
- .den_max = CLOCK_DIV_MAX,
- .den_step = 1
- };
- static snd_pcm_hw_constraint_ratnums_t constraint_rates = {
- .nrats = 1,
- .rats = &analog_clock
- };
-
-#if 0
- chip->reg_control &= ~CTL_DA_IOM_DA;
-#endif
- runtime->hw = snd_cx88_analog_hw;
- return snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
- &constraint_rates);
-}
-
-/*
* audio open callback
*/
static int snd_cx88_pcm_open(snd_pcm_substream_t *substream)
@@ -366,10 +216,8 @@ static int snd_cx88_pcm_open(snd_pcm_substream_t *substream)
if (test_and_set_bit(0, &chip->opened))
return -EBUSY;
- if (substream->pcm->device == DEVICE_DIGITAL)
- err = snd_cx88_set_digital_hw(chip, runtime);
- else
- err = snd_cx88_set_analog_hw(chip, runtime);
+ err = snd_cx88_set_digital_hw(chip, runtime);
+
if (err < 0)
goto _error;
@@ -422,8 +270,8 @@ static int snd_cx88_hw_free(snd_pcm_substream_t * substream)
static int snd_cx88_prepare(snd_pcm_substream_t *substream)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- int decimation;
+// snd_pcm_runtime_t *runtime = substream->runtime;
+// int decimation;
spin_lock_irq(&chip->reg_lock);
@@ -450,68 +298,13 @@ static int snd_cx88_prepare(snd_pcm_substream_t *substream)
return 0;
}
-/*
- * BOARD Specific: Sets audio DMA
- * FIXME: move to cx88-core
- */
-
-static int start_audio_dma(snd_cx88_card_t *dev)
-{
- struct cx88_core *core = dev->core;
-#if 0
- /* setup fifo + format - out channel */
- cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26],
- dev->buf->bpl, dev->buf->risc.dma1);
-#endif
-
- /* FIXME reset counter */
- cx_write(MO_VIDY_GPCNTRL,GP_COUNT_CONTROL_RESET);
-
- /* enable irqs */
- cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x01);
-
- /* Enables corresponding bits at AUD_INT_STAT */
-#if 1
- cx_set(MO_AUD_INTMSK, (1<<21)||(1<<19));
-#endif
-
- /* start dma */
- cx_set(MO_DEV_CNTRL2, (1<<5)); /* Enables Risc Processor */
- cx_set(MO_AUD_DMACNTRL, 0x11); /* audio downstream FIFO and RISC enable */
-
- return 0;
-}
-
-/*
- * BOARD Specific: Resets audio DMA
- * FIXME: move to cx88-core
- */
-static int stop_audio_dma(snd_cx88_card_t *dev)
-{
- struct cx88_core *core = dev->core;
-
- /* stop dma */
- cx_clear(MO_AUD_DMACNTRL, 0x11);
-
- /* disable irqs */
- cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x01);
-
-/* FIXME: Should only be cleared if video is also disabled
- * Can be a counter - when zero, clear intmask.
- */
-#if 0
- cx_clear(MO_PCI_INTMSK, 0x000001);
-#endif
- cx_set(MO_AUD_INTMSK, 0);
- return 0;
-}
/*
* trigger callback
*/
static int snd_cx88_card_trigger(snd_pcm_substream_t *substream, int cmd)
{
- snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
+// snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
@@ -528,8 +321,8 @@ static int snd_cx88_card_trigger(snd_pcm_substream_t *substream, int cmd)
*/
static snd_pcm_uframes_t snd_cx88_pointer(snd_pcm_substream_t *substream)
{
- snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+// snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
+// snd_pcm_runtime_t *runtime = substream->runtime;
// return (snd_pcm_uframes_t)bytes_to_frames(runtime, chip->current_line * chip->line_bytes);
}
@@ -555,8 +348,7 @@ static snd_pcm_ops_t snd_cx88_pcm_ops = {
static int __devinit snd_cx88_pcm(snd_cx88_card_t *chip, int device, char *name)
{
int err;
-#if 0
- snd_cx88_pcm_t *pcm;
+ snd_pcm_t *pcm;
err = snd_pcm_new(chip->card, name, device, 0, 1, &pcm);
if (err < 0)
@@ -569,7 +361,6 @@ static int __devinit snd_cx88_pcm(snd_cx88_card_t *chip, int device, char *name)
snd_dma_pci_data(chip->pci),
128 * 1024,
(255 * 4092 + 1023) & ~1023);
-#endif
}
/****************************************************************************
@@ -580,36 +371,37 @@ static int snd_cx88_capture_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
info->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
info->count = 1;
info->value.integer.min = 0;
- info->value.integer.max = 15;
+ info->value.integer.max = 0x3f;
+
return 0;
}
+/* OK - TODO: test it */
static int snd_cx88_capture_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
{
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
+ struct cx88_core *core=chip->core;
+
+ value->value.integer.value[0] = 0x3f - (cx_read(AUD_VOL_CTL) & 0x3f);
-#if 0
- value->value.integer.value[0] = (chip->reg_control & CTL_A_GAIN_MASK) >> CTL_A_GAIN_SHIFT;
-#endif
return 0;
}
+/* OK - TODO: test it */
static int snd_cx88_capture_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
{
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
+ struct cx88_core *core=chip->core;
+ int v;
u32 old_control;
- int changed;
-#if 0
spin_lock_irq(&chip->reg_lock);
- old_control = chip->reg_control;
- chip->reg_control = (chip->reg_control & ~CTL_A_GAIN_MASK)
- | (value->value.integer.value[0] << CTL_A_GAIN_SHIFT);
- snd_cx88_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control);
- changed = old_control != chip->reg_control;
+ old_control = 0x3f - (cx_read(AUD_VOL_CTL) & 0x3f);
+ v = 0x3f - (value->value.integer.value[0] & 0x3f);
+ cx_andor(AUD_VOL_CTL, 0x3f, v);
spin_unlock_irq(&chip->reg_lock);
-#endif
- return changed;
+
+ return v != old_control;
}
static snd_kcontrol_new_t snd_cx88_capture_volume = {
@@ -620,50 +412,10 @@ static snd_kcontrol_new_t snd_cx88_capture_volume = {
.put = snd_cx88_capture_volume_put,
};
-static int snd_cx88_capture_boost_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *info)
-{
- info->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
- info->count = 1;
- info->value.integer.min = 0;
- info->value.integer.max = 1;
- return 0;
-}
-
-static int snd_cx88_capture_boost_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
-{
- snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
-#if 0
- value->value.integer.value[0] = !! (chip->reg_control & CTL_A_G2X);
-#endif
- return 0;
-}
-
-static int snd_cx88_capture_boost_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
-{
- snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
- u32 old_control;
- int changed;
-
+/*
+ ***************************************
+ */
#if 0
- spin_lock_irq(&chip->reg_lock);
- old_control = chip->reg_control;
- chip->reg_control = (chip->reg_control & ~CTL_A_G2X)
- | (value->value.integer.value[0] ? CTL_A_G2X : 0);
- snd_cx88_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control);
- changed = chip->reg_control != old_control;
- spin_unlock_irq(&chip->reg_lock);
-#endif
- return changed;
-}
-
-static snd_kcontrol_new_t snd_cx88_capture_boost = {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Capture Boost",
- .info = snd_cx88_capture_boost_info,
- .get = snd_cx88_capture_boost_get,
- .put = snd_cx88_capture_boost_put,
-};
-
static int snd_cx88_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *info)
{
static char *texts[3] = {"TV Tuner", "FM", "Mic/Line"};
@@ -680,9 +432,9 @@ static int snd_cx88_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
static int snd_cx88_capture_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
{
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
-#if 0
+/*#if 0*/
value->value.enumerated.item[0] = (chip->reg_control & CTL_A_SEL_MASK) >> CTL_A_SEL_SHIFT;
-#endif
+/*#endif*/
return 0;
}
@@ -691,7 +443,7 @@ static int snd_cx88_capture_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
u32 old_control;
int changed;
-#if 0
+/*#if 0*/
spin_lock_irq(&chip->reg_lock);
old_control = chip->reg_control;
chip->reg_control = (chip->reg_control & ~CTL_A_SEL_MASK)
@@ -699,7 +451,7 @@ static int snd_cx88_capture_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
snd_cx88_writel(chip, REG_GPIO_DMA_CTL, chip->reg_control);
changed = chip->reg_control != old_control;
spin_unlock_irq(&chip->reg_lock);
-#endif
+/*#endif*/
return changed;
}
@@ -711,6 +463,217 @@ static snd_kcontrol_new_t snd_cx88_capture_source = {
.put = snd_cx88_capture_source_put,
};
+#endif
+
+/****************************************************************************
+ Basic Flow for Sound Devices
+ ****************************************************************************/
+
+/*
+ * PCI ID Table
+ */
+
+struct pci_device_id cx88_audio_pci_tbl[] = {
+ {0x14f1,0x8800,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
+ {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
+ {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
+ {0, }
+};
+MODULE_DEVICE_TABLE(pci, cx88_audio_pci_tbl);
+
+/*
+ * Chip-specific destructor
+ */
+
+static int snd_cx88_free(snd_cx88_card_t *chip)
+{
+#if 0
+ if (chip->mmio) {
+ snd_bt87x_stop(chip);
+ if (chip->irq >= 0)
+ synchronize_irq(chip->irq);
+
+ iounmap(chip->mmio);
+ }
+#endif
+ if (chip->irq >= 0)
+ free_irq(chip->irq, chip);
+
+ /* free memory */
+ cx88_core_put(chip->core,chip->pci);
+
+ pci_release_regions(chip->pci);
+ pci_disable_device(chip->pci);
+
+ kfree(chip);
+ return 0;
+}
+
+/*
+ * Component Destructor
+ */
+static int snd_cx88_dev_free(snd_device_t *device)
+{
+ snd_cx88_card_t *chip = device->device_data;
+ return snd_cx88_free(chip);
+}
+
+
+/*
+ * Alsa Constructor - Component probe
+ */
+
+static int devno=0;
+
+static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
+ snd_cx88_card_t **rchip)
+{
+ snd_cx88_card_t *chip;
+ struct cx88_core *core;
+ int err;
+ static snd_device_ops_t ops = {
+ .dev_free = snd_cx88_dev_free
+ };
+
+ *rchip = NULL;
+
+ err = pci_enable_device(pci);
+ if (err < 0)
+ return err;
+
+ chip = kmalloc(sizeof(*chip),GFP_KERNEL);
+ if (NULL == chip) {
+ pci_disable_device(pci);
+ return -ENOMEM;
+ }
+ memset(chip,0,sizeof(*chip));
+
+ /* pci init */
+ chip->card = card;
+ chip->pci = pci;
+ chip->irq = -1;
+ spin_lock_init(&chip->reg_lock);
+
+ core = cx88_core_get(chip->pci);
+ if (NULL == core) {
+ err = -EINVAL;
+ kfree (chip);
+ return err;
+ }
+ chip->core = core;
+#if 1
+ chip->dig_rate=48000;
+#endif
+
+ /* print pci info */
+ pci_read_config_byte(pci, PCI_CLASS_REVISION, &chip->pci_rev);
+ pci_read_config_byte(pci, PCI_LATENCY_TIMER, &chip->pci_lat);
+
+ printk(KERN_INFO "ALSA %s/%i: found at %s, rev: %d, irq: %d, "
+ "latency: %d, mmio: 0x%lx\n", core->name, devno,
+ pci_name(pci), chip->pci_rev, pci->irq,
+ chip->pci_lat,pci_resource_start(pci,0));
+
+ pci_set_master(pci);
+ if (!pci_dma_supported(pci,0xffffffff)) {
+ printk("%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
+ err = -EIO;
+ kfree (chip);
+ return err;
+ }
+
+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
+ if (err < 0) {
+ snd_cx88_free(chip);
+ return err;
+ }
+ snd_card_set_dev(card, &pci->dev);
+
+ *rchip = chip;
+
+ return 0;
+}
+
+static int __devinit cx88_audio_initdev(struct pci_dev *pci,
+ const struct pci_device_id *pci_id)
+{
+ snd_card_t *card;
+ snd_cx88_card_t *chip;
+ int err;
+
+ if (devno >= SNDRV_CARDS)
+ return (-ENODEV);
+
+ if (!enable[devno]) {
+ ++devno;
+ return (-ENOENT);
+ }
+
+ card = snd_card_new(index[devno], id[devno], THIS_MODULE, 0);
+ if (!card)
+ return (-ENOMEM);
+
+ err = snd_cx88_create(card, pci, &chip);
+ if (err < 0)
+ return (err);
+
+/*
+ err = snd_cx88_pcm(chip, DEVICE_DIGITAL, "CX88 Digital");
+ if (err < 0)
+ goto fail_free;
+*/
+ err = snd_ctl_add(card, snd_ctl_new1(&snd_cx88_capture_volume, chip));
+ if (err < 0) {
+ snd_card_free(card);
+ return (err);
+ }
+
+ strcpy (card->driver, "CX88_ALSA");
+ sprintf(card->shortname, "Conexant CX%x", pci->device);
+ sprintf(card->longname, "%s at %#lx",
+ card->shortname, pci_resource_start(pci, 0));
+ strcpy (card->mixername, "CX88");
+
+ printk ("%s/%i: Alsa support for cx2388x boards\n",
+ card->driver,devno);
+
+ err = snd_card_register(card);
+ if (err < 0) {
+ snd_card_free(card);
+ return (err);
+ }
+
+ pci_set_drvdata(pci,card);
+
+ devno++;
+ return 0;
+}
+/*
+ * ALSA destructor
+ */
+static void __devexit cx88_audio_finidev(struct pci_dev *pci)
+{
+ snd_card_free(pci_get_drvdata(pci));
+ pci_set_drvdata(pci, NULL);
+
+ devno--;
+}
+
+#if 0
+ .suspend = cx88_audio_suspend,
+ .resume = cx88_audio_resume,
+#endif
+/*
+ * PCI driver definition
+ */
+
+static struct pci_driver cx88_audio_pci_driver = {
+ .name = "cx88_audio",
+ .id_table = cx88_audio_pci_tbl,
+ .probe = cx88_audio_initdev,
+ .remove = cx88_audio_finidev,
+ SND_PCI_PM_CALLBACKS
+};
/****************************************************************************
LINUX MODULE INIT
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index 4a1633d9e..2423fb63a 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,12 @@
+2005-08-13 22:56 mchehab
+
+ * cx88-alsa.c:
+ - snd register working. Also Capture control.
+ - pending: pcm functions and fix some trouble when inserting it
+ with other cx88 functions (cx8800) for example.
+
+ Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
+
2005-08-12 23:47 nshmyrev
* compat.h:
- Fix build with kernel earlier than 2.6.9.