diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-03 10:48:59 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-03 10:48:59 -0400 |
commit | fe3d393eda2a716c2ea7fcd63e105657911ed245 (patch) | |
tree | d21cb1c2a083a7233fdc3c77a7d79a772f39545b /sound/pci/lola | |
parent | 0f8f56c959c9c4a65a5ad13f1b49d97db30b5c2f (diff) |
ALSA: lola - Add Lola-specific module options
Added granularity and sample_rate_min module options.
The former controls the h/w access granularity. As default, it's set
to the max value 32.
The latter controls the minimum sample rate in Hz, as default 16000.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/lola')
-rw-r--r-- | sound/pci/lola/lola.c | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index 4d8221505b9e..7c13ace3c33b 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <sound/initval.h> | 32 | #include <sound/initval.h> |
33 | #include "lola.h" | 33 | #include "lola.h" |
34 | 34 | ||
35 | /* Standard options */ | ||
35 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
36 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
37 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 38 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
@@ -43,6 +44,28 @@ MODULE_PARM_DESC(id, "ID string for Digigram Lola driver."); | |||
43 | module_param_array(enable, bool, NULL, 0444); | 44 | module_param_array(enable, bool, NULL, 0444); |
44 | MODULE_PARM_DESC(enable, "Enable Digigram Lola driver."); | 45 | MODULE_PARM_DESC(enable, "Enable Digigram Lola driver."); |
45 | 46 | ||
47 | /* Lola-specific options */ | ||
48 | |||
49 | /* for instance use always max granularity which is compatible | ||
50 | * with all sample rates | ||
51 | */ | ||
52 | static int granularity[SNDRV_CARDS] = { | ||
53 | [0 ... (SNDRV_CARDS - 1)] = LOLA_GRANULARITY_MAX | ||
54 | }; | ||
55 | |||
56 | /* below a sample_rate of 16kHz the analogue audio quality is NOT excellent */ | ||
57 | static int sample_rate_min[SNDRV_CARDS] = { | ||
58 | [0 ... (SNDRV_CARDS - 1) ] = 16000 | ||
59 | }; | ||
60 | |||
61 | module_param_array(granularity, int, NULL, 0444); | ||
62 | MODULE_PARM_DESC(granularity, "Granularity value"); | ||
63 | module_param_array(sample_rate_min, int, NULL, 0444); | ||
64 | MODULE_PARM_DESC(sample_rate_min, "Minimal sample rate"); | ||
65 | |||
66 | /* | ||
67 | */ | ||
68 | |||
46 | MODULE_LICENSE("GPL"); | 69 | MODULE_LICENSE("GPL"); |
47 | MODULE_SUPPORTED_DEVICE("{{Digigram, Lola}}"); | 70 | MODULE_SUPPORTED_DEVICE("{{Digigram, Lola}}"); |
48 | MODULE_DESCRIPTION("Digigram Lola driver"); | 71 | MODULE_DESCRIPTION("Digigram Lola driver"); |
@@ -536,7 +559,7 @@ static int lola_dev_free(struct snd_device *device) | |||
536 | } | 559 | } |
537 | 560 | ||
538 | static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci, | 561 | static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci, |
539 | struct lola **rchip) | 562 | int dev, struct lola **rchip) |
540 | { | 563 | { |
541 | struct lola *chip; | 564 | struct lola *chip; |
542 | int err; | 565 | int err; |
@@ -564,14 +587,16 @@ static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci, | |||
564 | chip->pci = pci; | 587 | chip->pci = pci; |
565 | chip->irq = -1; | 588 | chip->irq = -1; |
566 | 589 | ||
567 | /* below a sample_rate of 16kHz the analogue audio quality | 590 | chip->sample_rate_min = sample_rate_min[dev]; |
568 | * is NOT excellent | 591 | |
569 | */ | 592 | chip->granularity = granularity[dev]; |
570 | chip->sample_rate_min = 16000; | 593 | /* FIXME */ |
571 | /* for instance use always max granularity which is compatible | 594 | if (chip->granularity != LOLA_GRANULARITY_MAX) { |
572 | * with all sample rates | 595 | snd_printk(KERN_WARNING SFX |
573 | */ | 596 | "Only %d granularity is supported for now\n", |
574 | chip->granularity = LOLA_GRANULARITY_MAX; | 597 | LOLA_GRANULARITY_MAX); |
598 | chip->granularity = LOLA_GRANULARITY_MAX; | ||
599 | } | ||
575 | 600 | ||
576 | err = pci_request_regions(pci, DRVNAME); | 601 | err = pci_request_regions(pci, DRVNAME); |
577 | if (err < 0) { | 602 | if (err < 0) { |
@@ -674,7 +699,7 @@ static int __devinit lola_probe(struct pci_dev *pci, | |||
674 | 699 | ||
675 | snd_card_set_dev(card, &pci->dev); | 700 | snd_card_set_dev(card, &pci->dev); |
676 | 701 | ||
677 | err = lola_create(card, pci, &chip); | 702 | err = lola_create(card, pci, dev, &chip); |
678 | if (err < 0) | 703 | if (err < 0) |
679 | goto out_free; | 704 | goto out_free; |
680 | card->private_data = chip; | 705 | card->private_data = chip; |