Commit a866623c authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Linus Torvalds

[PATCH] v4l: 727: fixed a bug that caused some saa7133 code to run on saa7134 boards

- Fixed a bug that caused some saa7133 code to run on saa7134 boards
Signed-off-by: default avatarRicardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: default avatarNickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b2c15ea9
...@@ -45,9 +45,6 @@ MODULE_PARM_DESC(alsa_debug,"enable debug messages [alsa]"); ...@@ -45,9 +45,6 @@ MODULE_PARM_DESC(alsa_debug,"enable debug messages [alsa]");
* Configuration macros * Configuration macros
*/ */
#define MAX_PCM_DEVICES 1
#define MAX_PCM_SUBSTREAMS 1
/* defaults */ /* defaults */
#define MAX_BUFFER_SIZE (256*1024) #define MAX_BUFFER_SIZE (256*1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U16_BE #define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U16_BE
...@@ -804,6 +801,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -804,6 +801,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
break; break;
} }
break;
case PCI_DEVICE_ID_PHILIPS_SAA7133: case PCI_DEVICE_ID_PHILIPS_SAA7133:
case PCI_DEVICE_ID_PHILIPS_SAA7135: case PCI_DEVICE_ID_PHILIPS_SAA7135:
xbarin = 0x03; // adc xbarin = 0x03; // adc
...@@ -833,6 +831,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -833,6 +831,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, 0); saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, 0);
saa_writel(SAA7133_ANALOG_IO_SELECT, 0); saa_writel(SAA7133_ANALOG_IO_SELECT, 0);
} }
break;
} }
} }
...@@ -891,7 +890,7 @@ static int snd_saa7134_dev_free(snd_device_t *device) ...@@ -891,7 +890,7 @@ static int snd_saa7134_dev_free(snd_device_t *device)
* *
*/ */
int alsa_card_saa7134_create(struct saa7134_dev *saadev) int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devicenum)
{ {
static int dev; static int dev;
snd_card_t *card; snd_card_t *card;
...@@ -906,8 +905,11 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev) ...@@ -906,8 +905,11 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev)
if (!enable[dev]) if (!enable[dev])
return -ENODEV; return -ENODEV;
card = snd_card_new(index[dev], id[dev], THIS_MODULE, if (devicenum) {
0); card = snd_card_new(devicenum, id[dev], THIS_MODULE, 0);
} else {
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
}
if (card == NULL) if (card == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -949,7 +951,7 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev) ...@@ -949,7 +951,7 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev)
strcpy(card->shortname, "SAA7134"); strcpy(card->shortname, "SAA7134");
sprintf(card->longname, "%s at 0x%lx irq %d", sprintf(card->longname, "%s at 0x%lx irq %d",
card->shortname, chip->iobase, chip->irq); chip->saadev->name, chip->iobase, chip->irq);
if ((err = snd_card_register(card)) == 0) { if ((err = snd_card_register(card)) == 0) {
snd_saa7134_cards[dev] = card; snd_saa7134_cards[dev] = card;
......
...@@ -1027,7 +1027,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, ...@@ -1027,7 +1027,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
printk(KERN_INFO "%s: registered device mixer%d\n", printk(KERN_INFO "%s: registered device mixer%d\n",
dev->name,dev->oss.minor_mixer >> 4); dev->name,dev->oss.minor_mixer >> 4);
} else if (alsa) { } else if (alsa) {
alsa_card_saa7134_create(dev); alsa_card_saa7134_create(dev,dsp_nr[dev->nr]);
printk(KERN_INFO "%s: registered ALSA devices\n", printk(KERN_INFO "%s: registered ALSA devices\n",
dev->name); dev->name);
} }
......
...@@ -649,7 +649,7 @@ int saa7134_input_init1(struct saa7134_dev *dev); ...@@ -649,7 +649,7 @@ int saa7134_input_init1(struct saa7134_dev *dev);
void saa7134_input_fini(struct saa7134_dev *dev); void saa7134_input_fini(struct saa7134_dev *dev);
void saa7134_input_irq(struct saa7134_dev *dev); void saa7134_input_irq(struct saa7134_dev *dev);
int alsa_card_saa7134_create(struct saa7134_dev *saadev); int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devnum);
void alsa_card_saa7134_exit(void); void alsa_card_saa7134_exit(void);
void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status); void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment