git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
media
/
video
/
cx88
/
cx88-alsa.c
diff --git
a/drivers/media/video/cx88/cx88-alsa.c
b/drivers/media/video/cx88/cx88-alsa.c
index
2acccd6
..
e4355fd
100644
(file)
--- a/
drivers/media/video/cx88/cx88-alsa.c
+++ b/
drivers/media/video/cx88/cx88-alsa.c
@@
-4,7
+4,7
@@
* PCI function #1 of the cx2388x.
*
* (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org>
* PCI function #1 of the cx2388x.
*
* (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org>
- * (c) 2005 Mauro Carvalho Chehab <mchehab@
brturbo.com.br
>
+ * (c) 2005 Mauro Carvalho Chehab <mchehab@
infradead.org
>
* Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org>
* Based on dummy.c by Jaroslav Kysela <perex@suse.cz>
*
* Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org>
* Based on dummy.c by Jaroslav Kysela <perex@suse.cz>
*
@@
-63,7
+63,7
@@
struct cx88_audio_dev {
/* audio controls */
int irq;
/* audio controls */
int irq;
- s
nd_card_t
*card;
+ s
truct snd_card
*card;
spinlock_t reg_lock;
spinlock_t reg_lock;
@@
-82,7
+82,7
@@
struct cx88_audio_dev {
struct cx88_buffer *buf;
long opened;
struct cx88_buffer *buf;
long opened;
- s
nd_pcm_substream_t
*substream;
+ s
truct snd_pcm_substream
*substream;
};
typedef struct cx88_audio_dev snd_cx88_card_t;
};
typedef struct cx88_audio_dev snd_cx88_card_t;
@@
-96,7
+96,7
@@
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)] = 1};
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)] = 1};
-static s
nd_card_t
*snd_cx88_cards[SNDRV_CARDS];
+static s
truct snd_card
*snd_cx88_cards[SNDRV_CARDS];
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable cx88x soundcard. default enabled.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable cx88x soundcard. default enabled.");
@@
-111,7
+111,7
@@
MODULE_PARM_DESC(index, "Index value for cx88x capture interface(s).");
MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards");
MODULE_AUTHOR("Ricardo Cerqueira");
MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards");
MODULE_AUTHOR("Ricardo Cerqueira");
-MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@
brturbo.com.br
>");
+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@
infradead.org
>");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Conexant,23881},"
"{{Conexant,23882},"
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Conexant,23881},"
"{{Conexant,23882},"
@@
-262,7
+262,7
@@
static void cx8801_aud_irq(snd_cx88_card_t *chip)
/*
* BOARD Specific: Handles IRQ calls
*/
/*
* BOARD Specific: Handles IRQ calls
*/
-static irqreturn_t cx8801_irq(int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t cx8801_irq(int irq, void *dev_id)
{
snd_cx88_card_t *chip = dev_id;
struct cx88_core *core = chip->core;
{
snd_cx88_card_t *chip = dev_id;
struct cx88_core *core = chip->core;
@@
-303,7
+303,7
@@
static int dsp_buffer_free(snd_cx88_card_t *chip)
BUG_ON(!chip->dma_size);
dprintk(2,"Freeing buffer\n");
BUG_ON(!chip->dma_size);
dprintk(2,"Freeing buffer\n");
- videobuf_
dma_pci
_unmap(chip->pci, &chip->dma_risc);
+ videobuf_
pci_dma
_unmap(chip->pci, &chip->dma_risc);
videobuf_dma_free(&chip->dma_risc);
btcx_riscmem_free(chip->pci,&chip->buf->risc);
kfree(chip->buf);
videobuf_dma_free(&chip->dma_risc);
btcx_riscmem_free(chip->pci,&chip->buf->risc);
kfree(chip->buf);
@@
-320,7
+320,7
@@
static int dsp_buffer_free(snd_cx88_card_t *chip)
/*
* Digital hardware definition
*/
/*
* Digital hardware definition
*/
-static s
nd_pcm_hardware_t
snd_cx88_digital_hw = {
+static s
truct snd_pcm_hardware
snd_cx88_digital_hw = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@
-342,16
+342,16
@@
static snd_pcm_hardware_t snd_cx88_digital_hw = {
/*
* audio pcm capture runtime free
*/
/*
* audio pcm capture runtime free
*/
-static void snd_card_cx88_runtime_free(s
nd_pcm_runtime_t
*runtime)
+static void snd_card_cx88_runtime_free(s
truct snd_pcm_runtime
*runtime)
{
}
/*
* audio pcm capture open callback
*/
{
}
/*
* audio pcm capture open callback
*/
-static int snd_cx88_pcm_open(s
nd_pcm_substream_t
*substream)
+static int snd_cx88_pcm_open(s
truct snd_pcm_substream
*substream)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
- s
nd_pcm_runtime_t
*runtime = substream->runtime;
+ s
truct snd_pcm_runtime
*runtime = substream->runtime;
int err;
if (test_and_set_bit(0, &chip->opened))
int err;
if (test_and_set_bit(0, &chip->opened))
@@
-380,7
+380,7
@@
_error:
/*
* audio close callback
*/
/*
* audio close callback
*/
-static int snd_cx88_close(s
nd_pcm_substream_t
*substream)
+static int snd_cx88_close(s
truct snd_pcm_substream
*substream)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
@@
-393,8
+393,8
@@
static int snd_cx88_close(snd_pcm_substream_t *substream)
/*
* hw_params callback
*/
/*
* hw_params callback
*/
-static int snd_cx88_hw_params(s
nd_pcm_substream_t
* substream,
-
snd_pcm_hw_params_t
* hw_params)
+static int snd_cx88_hw_params(s
truct snd_pcm_substream
* substream,
+
struct snd_pcm_hw_params
* hw_params)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
struct cx88_buffer *buf;
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
struct cx88_buffer *buf;
@@
-429,7
+429,7
@@
static int snd_cx88_hw_params(snd_pcm_substream_t * substream,
videobuf_dma_init_kernel(&buf->vb.dma,PCI_DMA_FROMDEVICE,
(PAGE_ALIGN(buf->vb.size) >> PAGE_SHIFT));
videobuf_dma_init_kernel(&buf->vb.dma,PCI_DMA_FROMDEVICE,
(PAGE_ALIGN(buf->vb.size) >> PAGE_SHIFT));
- videobuf_
dma_pci
_map(chip->pci,&buf->vb.dma);
+ videobuf_
pci_dma
_map(chip->pci,&buf->vb.dma);
cx88_risc_databuffer(chip->pci, &buf->risc,
cx88_risc_databuffer(chip->pci, &buf->risc,
@@
-453,7
+453,7
@@
static int snd_cx88_hw_params(snd_pcm_substream_t * substream,
/*
* hw free callback
*/
/*
* hw free callback
*/
-static int snd_cx88_hw_free(s
nd_pcm_substream_t
* substream)
+static int snd_cx88_hw_free(s
truct snd_pcm_substream
* substream)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
@@
-469,7
+469,7
@@
static int snd_cx88_hw_free(snd_pcm_substream_t * substream)
/*
* prepare callback
*/
/*
* prepare callback
*/
-static int snd_cx88_prepare(s
nd_pcm_substream_t
*substream)
+static int snd_cx88_prepare(s
truct snd_pcm_substream
*substream)
{
return 0;
}
{
return 0;
}
@@
-478,7
+478,7
@@
static int snd_cx88_prepare(snd_pcm_substream_t *substream)
/*
* trigger callback
*/
/*
* trigger callback
*/
-static int snd_cx88_card_trigger(s
nd_pcm_substream_t
*substream, int cmd)
+static int snd_cx88_card_trigger(s
truct snd_pcm_substream
*substream, int cmd)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
int err;
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
int err;
@@
-505,10
+505,10
@@
static int snd_cx88_card_trigger(snd_pcm_substream_t *substream, int cmd)
/*
* pointer callback
*/
/*
* pointer callback
*/
-static snd_pcm_uframes_t snd_cx88_pointer(s
nd_pcm_substream_t
*substream)
+static snd_pcm_uframes_t snd_cx88_pointer(s
truct snd_pcm_substream
*substream)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
- s
nd_pcm_runtime_t
*runtime = substream->runtime;
+ s
truct snd_pcm_runtime
*runtime = substream->runtime;
if (chip->read_count) {
chip->read_count -= snd_pcm_lib_period_bytes(substream);
if (chip->read_count) {
chip->read_count -= snd_pcm_lib_period_bytes(substream);
@@
-525,7
+525,7
@@
static snd_pcm_uframes_t snd_cx88_pointer(snd_pcm_substream_t *substream)
/*
* operators
*/
/*
* operators
*/
-static s
nd_pcm_ops_t
snd_cx88_pcm_ops = {
+static s
truct snd_pcm_ops
snd_cx88_pcm_ops = {
.open = snd_cx88_pcm_open,
.close = snd_cx88_close,
.ioctl = snd_pcm_lib_ioctl,
.open = snd_cx88_pcm_open,
.close = snd_cx88_close,
.ioctl = snd_pcm_lib_ioctl,
@@
-542,7
+542,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;
static int __devinit snd_cx88_pcm(snd_cx88_card_t *chip, int device, char *name)
{
int err;
- s
nd_pcm_t
*pcm;
+ s
truct snd_pcm
*pcm;
err = snd_pcm_new(chip->card, name, device, 0, 1, &pcm);
if (err < 0)
err = snd_pcm_new(chip->card, name, device, 0, 1, &pcm);
if (err < 0)
@@
-557,7
+557,8
@@
static int __devinit snd_cx88_pcm(snd_cx88_card_t *chip, int device, char *name)
/****************************************************************************
CONTROL INTERFACE
****************************************************************************/
/****************************************************************************
CONTROL INTERFACE
****************************************************************************/
-static int snd_cx88_capture_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *info)
+static int snd_cx88_capture_volume_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *info)
{
info->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
info->count = 1;
{
info->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
info->count = 1;
@@
-568,7
+569,8
@@
static int snd_cx88_capture_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
}
/* OK - TODO: test it */
}
/* OK - TODO: test it */
-static int snd_cx88_capture_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
+static int snd_cx88_capture_volume_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *value)
{
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
struct cx88_core *core=chip->core;
{
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
struct cx88_core *core=chip->core;
@@
-579,7
+581,8
@@
static int snd_cx88_capture_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
}
/* OK - TODO: test it */
}
/* OK - TODO: test it */
-static int snd_cx88_capture_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *value)
+static int snd_cx88_capture_volume_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *value)
{
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
struct cx88_core *core=chip->core;
{
snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol);
struct cx88_core *core=chip->core;
@@
-595,7
+598,7
@@
static int snd_cx88_capture_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
return v != old_control;
}
return v != old_control;
}
-static s
nd_kcontrol_new_t
snd_cx88_capture_volume = {
+static s
truct snd_kcontrol_new
snd_cx88_capture_volume = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Volume",
.info = snd_cx88_capture_volume_info,
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Volume",
.info = snd_cx88_capture_volume_info,
@@
-613,7
+616,7
@@
static snd_kcontrol_new_t snd_cx88_capture_volume = {
* Only boards with eeprom and byte 1 at eeprom=1 have it
*/
* Only boards with eeprom and byte 1 at eeprom=1 have it
*/
-static struct pci_device_id cx88_audio_pci_tbl[] = {
+static struct pci_device_id cx88_audio_pci_tbl[]
__devinitdata
= {
{0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
{0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,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, }
@@
-641,7
+644,7
@@
static int snd_cx88_free(snd_cx88_card_t *chip)
/*
* Component Destructor
*/
/*
* Component Destructor
*/
-static void snd_cx88_dev_free(s
nd_card_t
* card)
+static void snd_cx88_dev_free(s
truct snd_card
* card)
{
snd_cx88_card_t *chip = card->private_data;
{
snd_cx88_card_t *chip = card->private_data;
@@
-654,8
+657,9
@@
static void snd_cx88_dev_free(snd_card_t * card)
*/
static int devno;
*/
static int devno;
-static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
- snd_cx88_card_t **rchip)
+static int __devinit snd_cx88_create(struct snd_card *card,
+ struct pci_dev *pci,
+ snd_cx88_card_t **rchip)
{
snd_cx88_card_t *chip;
struct cx88_core *core;
{
snd_cx88_card_t *chip;
struct cx88_core *core;
@@
-672,6
+676,11
@@
static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
chip = (snd_cx88_card_t *) card->private_data;
core = cx88_core_get(pci);
chip = (snd_cx88_card_t *) card->private_data;
core = cx88_core_get(pci);
+ if (NULL == core) {
+ err = -EINVAL;
+ kfree (chip);
+ return err;
+ }
if (!pci_dma_supported(pci,0xffffffff)) {
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
if (!pci_dma_supported(pci,0xffffffff)) {
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
@@
-687,17
+696,11
@@
static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
chip->irq = -1;
spin_lock_init(&chip->reg_lock);
chip->irq = -1;
spin_lock_init(&chip->reg_lock);
- cx88_reset(core);
- if (NULL == core) {
- err = -EINVAL;
- kfree (chip);
- return err;
- }
chip->core = core;
/* get irq */
err = request_irq(chip->pci->irq, cx8801_irq,
chip->core = core;
/* get irq */
err = request_irq(chip->pci->irq, cx8801_irq,
-
SA_SHIRQ | SA_INTERRUPT
, chip->core->name, chip);
+
IRQF_SHARED | IRQF_DISABLED
, chip->core->name, chip);
if (err < 0) {
dprintk(0, "%s: can't get IRQ %d\n",
chip->core->name, chip->pci->irq);
if (err < 0) {
dprintk(0, "%s: can't get IRQ %d\n",
chip->core->name, chip->pci->irq);
@@
-709,9
+712,9
@@
static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
pci_read_config_byte(pci, PCI_LATENCY_TIMER, &chip->pci_lat);
dprintk(1,"ALSA %s/%i: found at %s, rev: %d, irq: %d, "
pci_read_config_byte(pci, PCI_LATENCY_TIMER, &chip->pci_lat);
dprintk(1,"ALSA %s/%i: found at %s, rev: %d, irq: %d, "
- "latency: %d, mmio: 0x%lx\n", core->name, devno,
+ "latency: %d, mmio: 0x%l
l
x\n", core->name, devno,
pci_name(pci), chip->pci_rev, pci->irq,
pci_name(pci), chip->pci_rev, pci->irq,
- chip->pci_lat,pci_resource_start(pci,0));
+ chip->pci_lat,
(unsigned long long)
pci_resource_start(pci,0));
chip->irq = pci->irq;
synchronize_irq(chip->irq);
chip->irq = pci->irq;
synchronize_irq(chip->irq);
@@
-726,7
+729,7
@@
static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
static int __devinit cx88_audio_initdev(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
static int __devinit cx88_audio_initdev(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
- s
nd_card_t
*card;
+ s
truct snd_card
*card;
snd_cx88_card_t *chip;
int err;
snd_cx88_card_t *chip;
int err;
@@
-763,8
+766,8
@@
static int __devinit cx88_audio_initdev(struct pci_dev *pci,
strcpy (card->driver, "CX88x");
sprintf(card->shortname, "Conexant CX%x", pci->device);
strcpy (card->driver, "CX88x");
sprintf(card->shortname, "Conexant CX%x", pci->device);
- sprintf(card->longname, "%s at %#lx",
- card->shortname,
pci_resource_start(pci, 0));
+ sprintf(card->longname, "%s at %#l
l
x",
+ card->shortname,
(unsigned long long)
pci_resource_start(pci, 0));
strcpy (card->mixername, "CX88");
dprintk (0, "%s/%i: ALSA support for cx2388x boards\n",
strcpy (card->mixername, "CX88");
dprintk (0, "%s/%i: ALSA support for cx2388x boards\n",