Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248125
b: refs/heads/master
c: fe3d393
h: refs/heads/master
i:
  248123: 976d674
v: v3
  • Loading branch information
Takashi Iwai committed May 3, 2011
1 parent 9062331 commit e040585
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f8f56c959c9c4a65a5ad13f1b49d97db30b5c2f
refs/heads/master: fe3d393eda2a716c2ea7fcd63e105657911ed245
45 changes: 35 additions & 10 deletions trunk/sound/pci/lola/lola.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <sound/initval.h>
#include "lola.h"

/* Standard options */
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
Expand All @@ -43,6 +44,28 @@ MODULE_PARM_DESC(id, "ID string for Digigram Lola driver.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable Digigram Lola driver.");

/* Lola-specific options */

/* for instance use always max granularity which is compatible
* with all sample rates
*/
static int granularity[SNDRV_CARDS] = {
[0 ... (SNDRV_CARDS - 1)] = LOLA_GRANULARITY_MAX
};

/* below a sample_rate of 16kHz the analogue audio quality is NOT excellent */
static int sample_rate_min[SNDRV_CARDS] = {
[0 ... (SNDRV_CARDS - 1) ] = 16000
};

module_param_array(granularity, int, NULL, 0444);
MODULE_PARM_DESC(granularity, "Granularity value");
module_param_array(sample_rate_min, int, NULL, 0444);
MODULE_PARM_DESC(sample_rate_min, "Minimal sample rate");

/*
*/

MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Digigram, Lola}}");
MODULE_DESCRIPTION("Digigram Lola driver");
Expand Down Expand Up @@ -536,7 +559,7 @@ static int lola_dev_free(struct snd_device *device)
}

static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci,
struct lola **rchip)
int dev, struct lola **rchip)
{
struct lola *chip;
int err;
Expand Down Expand Up @@ -564,14 +587,16 @@ static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci,
chip->pci = pci;
chip->irq = -1;

/* below a sample_rate of 16kHz the analogue audio quality
* is NOT excellent
*/
chip->sample_rate_min = 16000;
/* for instance use always max granularity which is compatible
* with all sample rates
*/
chip->granularity = LOLA_GRANULARITY_MAX;
chip->sample_rate_min = sample_rate_min[dev];

chip->granularity = granularity[dev];
/* FIXME */
if (chip->granularity != LOLA_GRANULARITY_MAX) {
snd_printk(KERN_WARNING SFX
"Only %d granularity is supported for now\n",
LOLA_GRANULARITY_MAX);
chip->granularity = LOLA_GRANULARITY_MAX;
}

err = pci_request_regions(pci, DRVNAME);
if (err < 0) {
Expand Down Expand Up @@ -674,7 +699,7 @@ static int __devinit lola_probe(struct pci_dev *pci,

snd_card_set_dev(card, &pci->dev);

err = lola_create(card, pci, &chip);
err = lola_create(card, pci, dev, &chip);
if (err < 0)
goto out_free;
card->private_data = chip;
Expand Down

0 comments on commit e040585

Please sign in to comment.