summaryrefslogtreecommitdiff
path: root/sound/pci/lola
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-05-03 16:48:59 +0200
committerTakashi Iwai <tiwai@suse.de>2011-05-03 16:48:59 +0200
commitfe3d393eda2a716c2ea7fcd63e105657911ed245 (patch)
treed21cb1c2a083a7233fdc3c77a7d79a772f39545b /sound/pci/lola
parent0f8f56c959c9c4a65a5ad13f1b49d97db30b5c2f (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.c45
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 @@
#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;
@@ -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");
@@ -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;
@@ -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) {
@@ -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;